title: Uncaught TypeError: Failed to execute 'importStylesheet' on 'XSLTProcessor': parameter 1 is not of type 'Node'
body: <p>I am trying to use XSL to translate an XML file into a neat table. For that I used the examples provided by W3schools which can be located <a href="http://www.w3schools.com/xsl/xsl_client.asp" rel="nofollow">here</a> as a starting point. Yet the browser(chrome) is throwing the error that is described in the title of this post. I even tried copying the exact same example on W3 only to be met with the same error. Tried debugging in Firefox, this is the console output<br>
  <code>TypeError: Argument 1 of XSLTProcessor.importStylesheet is not an object.</code></p>
  
  <p>A similar question was posted before and the solution was in changing the model from synchronous to async. I tried doing that through the onreadystatechange method but without success. Here is the code I worked with.  </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
      function loadXMLDoc(filename)
      {
      if (window.ActiveXObject)
        {
        xhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
      else
        {
        xhttp = new XMLHttpRequest();
        }
      xhttp.onreadystatechange = function() {
          if (xhttp.readyState == 4 &amp;&amp; xhttp.status == 200) {
          return xhttp.responseXML;
          }
      };
      xhttp.open("GET", filename);
      try {xhttp.responseType = "msxml-document"} catch(err) {} // Helping IE11
      xhttp.send("");
      }
  
      function displayResult()
      {
      xsl = loadXMLDoc("cdcatalog.xsl");
      xml = loadXMLDoc("cdcatalog.xml");
      // code for IE
      if (window.ActiveXObject || xhttp.responseType == "msxml-document")
        {
        ex = xml.transformNode(xsl);
        document.getElementById("dataTable").innerHTML = ex;
        }
      // code for Chrome, 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("dataTable").appendChild(resultDocument);
        }
      }   
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="displayResult()"&gt;
  &lt;div id="dataTable" /&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>
  Thank you for all the help!</p>