I am trying to display a data island in a page using an XSL stylesheet. I am getting the error: The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.
Can someone tell me what I am doing wrong? Please?
I can't display the data island, but I have verified that the for-each and value-of statements are correct.
This script allows the data island to be displayed based on the stylesheet.
<script for="window" event="onload">
xslTarget.innerHTML = data.transformNode(style.XMLDocument);
</script>
I am trying to display my data island using:
<div id="xslTarget"></div>
Here is the stylesheet.
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<TABLE>
<TR>
<TD>Trans ID</TD>
<TD>Trans Date</TD>
<TD>Description</TD>
<TD align="right">Amount</TD>
</TR>
<xsl:for-each select="TRANSACTIONS/TRANSACTION order-by="TRANSDATE"> ">
<TR>
<TD>
<xsl:value-of select="TRANSID" />
</TD>
<TD>
<xsl:value-of select="TRANSDATE" />
</TD>
<TD>
<xsl:value-of select="DESCRIPTION" />
</TD>
<TD>
<xsl:value-of select="AMOUNT" />
</TD>
</TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>
Can someone tell me what I am doing wrong? Please?
I can't display the data island, but I have verified that the for-each and value-of statements are correct.
This script allows the data island to be displayed based on the stylesheet.
<script for="window" event="onload">
xslTarget.innerHTML = data.transformNode(style.XMLDocument);
</script>
I am trying to display my data island using:
<div id="xslTarget"></div>
Here is the stylesheet.
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<TABLE>
<TR>
<TD>Trans ID</TD>
<TD>Trans Date</TD>
<TD>Description</TD>
<TD align="right">Amount</TD>
</TR>
<xsl:for-each select="TRANSACTIONS/TRANSACTION order-by="TRANSDATE"> ">
<TR>
<TD>
<xsl:value-of select="TRANSID" />
</TD>
<TD>
<xsl:value-of select="TRANSDATE" />
</TD>
<TD>
<xsl:value-of select="DESCRIPTION" />
</TD>
<TD>
<xsl:value-of select="AMOUNT" />
</TD>
</TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>
Comment