Illegal Characters in Path for XSLT Tranformation : <p>I am writing an XSLT transformation to translate a XML credit report.  </p>

<p>When I run the following code I am getting "Illegal Characters in Path" error.  Not sure what I am missing.  I want this method to return a HTML string.</p>

<p>I have tested the XSLT transform on the XML and it works.  This code fails on the transform.Load function with the "Illegal Characters in Path" error. </p>

<p>What am I missing here?</p>

<pre><code>    private string FormatCreditReport(string inputXml)
    {
        var xsltTransform = new XslCompiledTransform();
        var webRootPath = HostingEnvironment.ApplicationPhysicalPath;
        var path = webRootPath
                   + "XSLT_Stylesheets"
                   + Path.DirectorySeparatorChar
                   + "CreditReportTransform.xslt";
        var xsltTemplate = File.ReadAllText(path);

        xsltTransform.Load(xsltTemplate);

        StringWriter results = new StringWriter();
        using (var reader = XmlReader.Create(new StringReader(inputXml)))
        {
            xsltTransform.Transform(reader, null, results);
        }
        return results.ToString();
    }
</code></pre>

<p>XSLT Document:</p>

<p></p>

<pre><code>&lt;xsl:template match="/"&gt;

  &lt;html&gt;
    &lt;body&gt;

      &lt;table border ="1"&gt;

        &lt;tr&gt;
          &lt;th&gt;&lt;h2&gt;Credit File&lt;/h2&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;&lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;File Since Date&lt;/td&gt;
          &lt;td&gt;&lt;xsl:value-of select="EfxTransmit/EfxReport/USConsumerCreditReports/USConsumerCreditReport/USHeader/CreditFile/FileSinceDate"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Date of Last Activity&lt;/td&gt;
          &lt;td&gt;&lt;xsl:value-of select="EfxTransmit/EfxReport/USConsumerCreditReports/USConsumerCreditReport/USHeader/CreditFile/DateOfLastActivity"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Date of Request&lt;/td&gt;
          &lt;td&gt;&lt;xsl:value-of select="EfxTransmit/EfxReport/USConsumerCreditReports/USConsumerCreditReport/USHeader/CreditFile/DateOfRequest"/&gt;&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;&lt;/tr&gt;

        &lt;tr&gt;
          &lt;th&gt;&lt;h2&gt;Subject&lt;/h2&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Last Name&lt;/td&gt;
          &lt;td&gt;&lt;xsl:value-of select="EfxTransmit/EfxReport/USConsumerCreditReports/USConsumerCreditReport/USHeader/Subject/LastName"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;


  &lt;/body&gt;
&lt;/html&gt;

&lt;/xsl:template&gt;
</code></pre>

<p></p>
