1
votes

My XSLT stylesheet will not render and I'm completely stumped as to why.

Here is my XML:

    <?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="XSLTFile.xsl"?>

<Envelope>

  <Guid>1</Guid>
  <Guid>3</Guid>
  <Guid>2</Guid>
</Envelope>

XSLT:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
    <html>
      <body>
        <h2>Test</h2>
        <xsl:value-of select="Envelope/Guid"/>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

Output when not running compatibility mode (IE 9): 1 2 3 Output when running compatibility mode:

The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML documen...

1

1 Answers

1
votes

I reproduced your issue: href="XSLTFile.xsl" is invalid address of the referenced style sheet. Correct it or put your XSL file in the same location as XML file.