title: Problems applying a style sheet (XSL) to an (XML) in IE via (JavaScript)
body: <p>This works in Firefox, but doesn't work in IE. IE complains about line 18: </p>
  
  <pre><code>docCache.stylesheet = xsl;
  </code></pre>
  
  <p>Reporting that:</p>
  
  <pre><code>Message: The stylesheet does not contain a document element.  The stylesheet may be empty, or it may not be a well-formed XML document.
  </code></pre>
  
  <p>Here is the function:</p>
  
  <pre><code>function display(dname, compt) {    
  document.getElementById(dname+"Table").innerHTML="";
  
  // IE
  if (window.ActiveXObject) {
      xml = new ActiveXObject("MSXML2.DOMDocument.3.0");
      xml.async = false;
      xml.load(dname+".xml");
  
      xsl = new ActiveXObject("MSXML2.FreeThreadedDOMDocument.3.0");
      xsl.async = false;
      xsl.load(dname+".xsl");
  
      docCache = new ActiveXObject("MSXML2.XSLTemplate.3.0");
      docCache.stylesheet = xsl;
  
      docProcessor = docCache.createProcessor();
      docProcessor.input = xml;
  
      docProcessor.addParameter("competitor", compt);
  
      docProcessor.transform();
  
      document.getElementById(dname+"Table").innerHTML = docProcessor.output;
  }
  // Mozilla, Firefox, Opera, etc.
  else if (document.implementation &amp;&amp; document.implementation.createDocument) {
  
          xml=loadXMLDoc(dname+".xml");
          xsl=loadXMLDoc(dname+".xsl");
          xsltProcessor=new XSLTProcessor();
          xsltProcessor.importStylesheet(xsl);    
          xsltProcessor.setParameter(null, "competitor", compt);          
          resultDocument = xsltProcessor.transformToFragment(xml,document);
          document.getElementById(dname+"Table").appendChild(resultDocument);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And the XSL file:
        </p>
  
  <pre><code>  &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
    &lt;xsl:output method="html"/&gt;
    &lt;xsl:param name="competitor"/&gt;
    &lt;xsl:template match="/"&gt;
        The parameter value was: &lt;xsl:value-of select="$competitor"/&gt;
    &lt;/xsl:template&gt;
    &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Does anyone know why this is happening?</p>