Web Analytics Made Easy -
StatCounter Document Element - CodingForum


No announcement yet.

Document Element

  • 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);

    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="/">
    <TD>Trans ID</TD>
    <TD>Trans Date</TD>
    <TD align="right">Amount</TD>
    <xsl:for-each select="TRANSACTIONS/TRANSACTION order-by="TRANSDATE"> ">
    <xsl:value-of select="TRANSID" />
    <xsl:value-of select="TRANSDATE" />
    <xsl:value-of select="DESCRIPTION" />
    <xsl:value-of select="AMOUNT" />
    Last edited by JoeStone; Mar 8, 2004, 04:53 PM.

  • #2
    Appears to be several error on this line:
    <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!


    • #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.