Web Analytics Made Easy -
StatCounter Document Element - CodingForum

Announcement

Collapse
No announcement yet.

Document Element

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Document Element

    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>
    Last edited by JoeStone; Mar 8, 2004, 04:53 PM.

  • #2
    Appears to be several error on this line:
    Code:
    <xsl:for-each select="TRANSACTIONS/TRANSACTION order-by="TRANSDATE"> ">
    
    should be:
    
    <xsl:for-each select="TRANSACTIONS/TRANSACTION[color=red]"[/color] order-by="TRANSDATE">
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

    Comment


    • #3
      Thanks Me'

      I caught that one later. It actually was DOPE (Dumb Old Programmer Error) that was causing my problem. I totally missed the outermost level of the XML.

      Comment

      Working...
      X