xsl-list
[Top] [All Lists]

Node ordering question with preceding axis

2005-11-26 18:42:44
Hi,

    I have the following testcase:

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

        <xsl:output method="xml" omit-xml-declaration="yes" />

        <xsl:variable name="forest">
                <tree>One</tree>
                <tree>Two</tree>
                <tree><tree>Three</tree></tree>
                <tree><tree>Four</tree><tree>Five</tree></tree>
               
<tree><tree>Six</tree><tree>Seven</tree><tree>Eight</tree></tree>
        </xsl:variable>

        <xsl:template match="/">

                <xsl:value-of select="$forest//tree[text() =
'Eight']/preceding::*" />
        </xsl:template>

</xsl:stylesheet>

    When run, this code produces:

One Two Three Three FourFive Four Five Six Seven

    I'm not entirely clear about the expected behaviour of preceding
axis with temporary trees, but I was expecting that the for the last
"forest" of nodes, the node ordering would be "Seven" followed by
"Six"  since preceding is a reverse axis. What am I missing?

Thanks,
Kenneth

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>