title: Using MSXML 2.0 to perform XSLT Transformation
body: <p>I am trying some ways to perform the xslt transformation using xslt and xml as string.
  If we pass the url of the xml file then it works fine using load() method.</p>
  
  <pre><code>function init(xml, xslt) {
      var srcTree = new ActiveXObject("Msxml2.DOMDocument.6.0");
      srcTree.async=false;
      srcTree.load(xml); 
      var xsltTree= new ActiveXObject("Msxml2.DOMDocument.6.0");
      xsltTree.async = false;
      xsltTree.load(xslt);
      var resTree = document.getElementById("HTMLData");
      resTree.innerHTML = srcTree.transformNode(xsltTree);
  }
  </code></pre>
  
  <p>In the above method we are passing the location (url) of the xml and xslt. But as per requirements, we need to pass the entire xml and xslt as string (like <code>&lt;?xml version=</code> ....).
  If you find difficult to understand my question then also comment that this question
  is not easily understandable. Thanks in advance.</p>
  
  <p>Edit:</p>
  
  <p>the above function can be called using (example):</p>
  
  <pre><code>init('/myfiles/xml/books.xml', '/myfiles/xslt/style.xslt');
  </code></pre>
  
  <p>But i need to store the xml as a string variable in javascript and then pass these string
  variable to the init method. example:</p>
  
  <pre><code>var xmlDocument = '&lt;?xml version='1'?&gt;&lt;books&gt;....&lt;/books&gt;';
  var xsltDocument = '&lt;?xml version='1'?&gt;&lt;xsl xmlns:xsl='...'....&lt;/xsl&gt;';
  init(xmlDocument, xsltDcoument);
  </code></pre>