![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Using XSLT parameters in a browser transform [Thread Next] Re: Using XSLT parameters in a browser transformTo: NULL Date: 4/2/2004 1:06:00 PM "David" <qwerty1234@m...> wrote in message news:7bc493ab.0404020838.76b66b6a@p...... : I would like to be able to re-sort data in an HTML table on the : without returning to the server. It seems like an XSLT should be able : to accomplish this, but I can't find enough information... If you're using IE5.5 or later, this is pretty easy to do. Here's a bit of DHTML I wrote to grab an RSS feed from a web site: <html> <head> <title>BoardGameGeek Recent Additions</title> <link rel="stylesheet" type="text/css" href="rss_reader.css"/> <xml id="feed" src="http://www.boardgamegeek.com/feed.xml" async="false"/> <xml id="transform" src="rss_reader.xsl"/> </head> <body onload="document.body.innerHTML=document.all.feed.transformNode(document.all .transform);"> </body> </html> </head> </html> You can just load multiple transforms in the <head> and then write script that applies the various transforms to your XML in a manner similar to the way I'm doing it in the onload event handler. You can also write script that passes parameters to the transform, but this requires you to create an XSLTemplate object in script and manipulate it. You might be better off "passing" the parameter by setting an attribute on the document element of the XML, e.g.: onclick="document.all.feed.documentElement.setAttribute("sortOrder", "someField"); document.all.mytable.innerHTML = document.all.feed.transformNode(document.all.transform);" I think it's probably wise to set the async attribute to "false" for all xml elements in the page, though in this example it's not a problem because the stylesheet is on the same server as the page, and the RSS feed isn't, so the stylesheet is always loaded before the feed finishes loading. But I don't know how dependable that really is. Hope this helps. Bob Rossney rbr@w... | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
