This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Reverse order axis operators...


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]