how to run XSL file using JavaScript / HTML file
<p>i want to run xsl file using javascript function. I wrote a javascrpt function which is working well with Firefox and Crom but it is not working on Internet Explorer</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("NewXml.xml");
        xsl=loadXMLDoc("NewFile.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>Please help my by modifying this code or by another code so that i can work with Internet Explorer.</p>

<p>Thanks</p>
