|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Immediacy of preceding-siblings
Matthew Bentley wrote: > Does "preceding-sibling::*[1]" select the immediately preceding sibling > or would that be "preceding-sibling::*[last()]" ? Let's say you have <parent> <sibling num="1"/> <sibling num="2"/> <sibling num="3"/> </parent> and the current node is sibling number 3. preceding-sibling:: will select siblings 1 and 2, and the whitespace-only text nodes in between. * will reduce that set down to just those that are elements (siblings 1 and 2) [1] will reduce that set down to just the one at position 1 in that set. the position ordering depends on the directionality of the axis. for preceding axes, reverse document order is used. so sibling 2 is at position 1, and sibling 1 is at position 2. [last()] will instead reduce that set down to just the one at the last position in the set. this will be sibling 1. actually the function will be evaluated first, so saying [last()] is the same as [2]. - Mike ____________________________________________________________________ Mike J. Brown, software engineer at My XML/XSL resources: webb.net in Denver, Colorado, USA http://www.skew.org/xml/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








