How to display the same XML file with different XSLT?
I have an XML file acting as a dictionary in a bilingual website. But for a certain XML file, you can only specify an XSLT to express it. How do I display the XML file with different XSLTs?
If you're using IE, you can remove the XSL reference from your XML document and use the following javascript (changing the names of the XML and XSL to your filenames).
<script type="text/javascript">
// Load XML
var xml = new ActiveXObject("MSXML2.DOMDocument")
xml.async = false
xml.load("yourfile.xml")
// Load the XSL
var xsl = new ActiveXObject("MSXML2.DOMDocument")
xsl.async = false
xsl.load("file1.xsl")