This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Reverse order axis operators...
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Sat, 12 Jan 2002 23:53:17 -0000
- Subject: RE: [xsl] Reverse order axis operators...
- Reply-to: xsl-list at lists dot mulberrytech dot com
> 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() < 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