[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Reverse order axis operators...


Subject: RE: [xsl] Reverse order axis operators...
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Sat, 12 Jan 2002 23:53:17 -0000

> I have MSXML 4.0 installed.  I have a question about the
> following Axis
> within an XPath expression:
> 	ancestor::
> 	ancestor-or-self::
> 	preceding::
> 	preceding-sibling::
>
> All the reference material abd W3c reading says that these
> four Axis should
> return node-list in reverse document order.

No, you've misread the spec. Any predicate used in a step using these axis
evaluates position() by considering the nodes in reverse document order, but
XSLT operations like xsl:for-each still process the resulting nodes in
forwards document order.

So <xsl:for-each select="ancestor::*[position() &lt; 3]">

will process the parent and grandparent elements, starting at the
grandparent.

Hope that's clear!

Mike Kay
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords