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

Re: Immediacy of preceding-siblings

Subject: Re: Immediacy of preceding-siblings
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 31 Aug 2000 21:44:05 -0600 (MDT)
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


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.