Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I transform an XML document using XSLT and add a parameter in IE?
    primarykey
    data
    text
    <p>I'm new to learning XSLT, and I've come across something I really don't quite understand. I need to add an XSLT parameter before transforming the document. I can do this for non-IE browsers like so:</p> <pre><code>function loadXMLDoc(dname) { if (window.XMLHttpRequest) { xhttp = new XMLHttpRequest(); } else { xhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET", dname, false); xhttp.send(""); return xhttp.responseXML; } function displayResult() { xml = loadXMLDoc("cdcatalog.xml"); xsl = loadXMLDoc("cdcatalog.xsl"); // code for IE if (window.ActiveXObject) { ex = xml.transformNode(xsl); document.getElementById("example").innerHTML = ex; } // code for Mozilla, Firefox, Opera, etc. else if (document.implementation &amp;&amp; document.implementation.createDocument) { xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); resultDocument = xsltProcessor.transformToFragment(xml, document); document.getElementById("example").appendChild(resultDocument); } } </code></pre> <p>Now, I can do it for non-IE browsers, a new XSLT Processor object is made, stylesheet imported, and you simply add the parameter before the transformation process. None of this seems to be happening for the IE version of the code though, and I can't simply add the parameter before the transformation. I've googled profusely and seen different things telling me to create new ActiveX objects of various different MSXML versions, and I'm deeply confused by the whole affair.</p> <p>Taking the above code, how do I do this: <br> <code>xsltProcessor.setParameter(null,"PARAMNAME","PARAMVALUE");</code> <br><br> except for IE and if possible, can someone explain how IE deals with the whole concept of XSLT differently to FF/O/C/other civilised browsers?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload