[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: TSchutzerWeissmann@xxxxxxxxxxxxxxxx
Date: Thu, 29 Aug 2002 11:49:37 +0100
RE:  preceding-sibling reversed ?
David,
[...]
> [@class = 'slide' and position() = 1]
> 
> selects all (at most one) of those nodes that satisify the stated
> condition.
> 
> however if you do it with two filters first 
> 
> preceding-sibling::div[@class = 'slide']
> 
> now the resulting node set is renumbered (still in reverse 
> order, as you
> are still in the same step) so now the [1] or equivalenetly 
> [position()
> = 1] selcts the first of _these_ elements, ie the first 
> element (looking
> back) with class slide.

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?

cheers,
Tom

 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.