[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: preceding-sibling reversed ?

Subject: RE: preceding-sibling reversed ?
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 29 Aug 2002 12:59:55 +0100
preceding sibling reverse
> 
> I'm still a bit perplexed. If you evaluate a nodeset in a 
> string context then only the first node in the nodeset is 
> considered. That's why
> 	following-sibling::div[@class = 'slide']/@id is the same as
> 	following-sibling::div[@class = 'slide'][1]/@id.
> On the other hand, 
> 	preceding-sibling::div[@class = 'slide']/@id is the same as
> 	preceding-sibling::div[@class = 'slide'][last()]/@id.
> 
> So it seems as if the reversed axis doesn't come into play - 
> of the entire nodeset, only the first is considered, but it's 
> the first in *document order*. Why?
> 
A positional predicate in a step of a path expression considers the
nodes in axis order: so for a reverse axis, [1] selects the last node in
document order.

XSLT always processes node-sets in document order, and the conversion of
a node-set to a string always uses the node that is first in document
order; the axis that was used to select the nodes is irrelevant.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.