OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
XSLT styleswitching
This page's ID:
23117
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
You -could- do this client-side via the XMLHTTP object etc. (just recreate the XSLT object and load a new stylesheet into it) - but this would only work on IE 5.x/win32 and Mozilla 1-point-something. I don't think Safari (1.2 currently out at time of writing) has a native Javascript XSLT processor. Something like this would work for the former however (although server-side is really the way to go I think): [code] var xmlFile = "file.xml"; var xslFile = "file.xsl"; // IE method var xml = new ActiveXObject("Microsoft.XMLDOM"); xml.async = false; xml.load(xmlFile); var xsl = new ActiveXObject("Microsoft.XMLDOM"); xsl.async = false; xsl.load(xslFile); var result = (xml.transformNode(xsl)); // --------- // Mozilla etc. var xsl; var xslt = new XSLTProcessor(); var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", xslFile, false); xmlhttp.send(null); xsl = xmlhttp.responseXML; xslt.importStylesheet(xsl); xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", xmlFile, false); xmlhttp.send(null); var xmlSource = xmlhttp.responseXML; var resultDocument = xslt.transformToDocument(xmlSource); [/code] [small](Edited by [internallink=2276]Scott[/internallink] on 10-20-2004 03:00)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »