title: Can't get xsl:import or xsl:include to work on MSXML6
body: <p>I am trying to get MSXML6 XSLT import (or include) functionality working for my app. I have looked everywhere for a solution to this and have found a number of references to people for whom it seems to be working so I'm thinking I must be doing something wrong but I can't figure out what it is.</p>
  
  <p>Book.xml</p>
  
  <pre><code>&lt;Book&gt;
      &lt;Title&gt;A Christmas Carol&lt;/Title&gt;
      &lt;Author&gt;Charles Dickens&lt;/Author&gt;
      &lt;Binding&gt;Hardcover&lt;/Binding&gt;
      &lt;Price&gt;14.99&lt;/Price&gt;
      &lt;Comment/&gt;
  &lt;/Book&gt;
  </code></pre>
  
  <p>DefaultRules.xsl</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:include href="/Temp/Book.xsl"/&gt;
      &lt;xsl:output method="text" indent="no"/&gt;
  
      &lt;xsl:template match="/"&gt;
          &lt;xsl:apply-templates select="Book"/&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Book.xsl</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:template match="Book"&gt;
          &lt;xsl:text&gt;Title: &lt;/xsl:text&gt;
          &lt;xsl:apply-templates select="Title"/&gt;
          &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
          &lt;xsl:apply-templates select="Author"/&gt;
          &lt;xsl:text&gt; - $&lt;/xsl:text&gt;
          &lt;xsl:apply-templates select="Price"/&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Proto.cpp</p>
  
  <pre><code>int _tmain(int argc, _TCHAR* argv[])
  {
      CoInitialize(NULL);
  
      variant_t vResult;
      LPCTSTR output = NULL;
      MSXML2::IXMLDOMDocumentPtr pXml(__uuidof(MSXML2::DOMDocument60));
      MSXML2::IXMLDOMDocumentPtr pXslt(__uuidof(MSXML2::FreeThreadedDOMDocument60));
      MSXML2::IXSLTemplatePtr pTemplate(__uuidof(MSXML2::XSLTemplate60));
      MSXML2::IXSLProcessorPtr pProcessor;
      IStream *pOutStream;
      // load xml file with data and xsl file to transform
      // xml -&gt; html
      pXml-&gt;async = false;
      pXml-&gt;load(_bstr_t("Book.xml"));
      pXslt-&gt;resolveExternals = true;
      pXslt-&gt;async = false;
      pXslt-&gt;load(_bstr_t("/Temp/DefaultRules.xsl"));
      pTemplate-&gt;stylesheet = pXslt;
      pProcessor = pTemplate-&gt;createProcessor();
  
      CreateStreamOnHGlobal(NULL, TRUE, &amp;pOutStream);
      pProcessor-&gt;put_output(_variant_t(pOutStream));
      pProcessor-&gt;put_input(_variant_t((IUnknown*)pXml));
      pProcessor-&gt;transform();
      //get results of transformation and print them to stdout
      HGLOBAL hg = NULL;
      pOutStream-&gt;Write((void const*)"\0\0", 2, 0);
      GetHGlobalFromStream(pOutStream, &amp;hg);
      output = (LPCTSTR)GlobalLock(hg);
      wprintf(L"%s", output);
      GlobalUnlock(hg);
  
      //release before CoUninitialize()
      pXml.Release();
      pXslt.Release();
      pTemplate.Release();
      pProcessor.Release();
  
      CoUninitialize();
      getchar();
      return 0;
  }
  </code></pre>
  
  <p>The (correct) output I get from an XML tool (EditiX) is</p>
  
  <pre><code>Title: A Christmas Carol
  Charles Dickens - $14.99
  </code></pre>
  
  <p>The (incorrect) output that I get from MSXML6 transform is</p>
  
  <pre><code>A Christmas CarolCharles DickensHardcover14.99
  </code></pre>
  
  <p>It looks like the file specified for inclusion isn't being imported/included so I'm just getting the default template results although I don't get any error messages. As you can see, I am setting the resolveExternals flag to true (new for MSXML6). I have also tried loading it from the current folder as well as a specific folder (the above code uses /Temp). I have also tried using both xsl:import and xsl:include. The solution always works in the XML tool but always gives the incorrect result using the above code and MSXML6. I am using Windows 10 if that could be related.</p>