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

Re: reverse and forward order

Subject: Re: reverse and forward order
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 11 Apr 2003 14:53:58 -0400
xsl reverse order
At 10:57 AM 4/11/2003, David wrote:
What Dave means about paremthesese is

ancestor::*[1] gives you the first ancestor in reverse document order
               ie your parent
whereas
(ancestor::*)[1] gives you your first ancestor in document order, ie
                your most ancient ancestor; Adam (or Eve) in some
               cultures.

This leads to a bit of funniness, so that


ancestor::*[1] gives you what Dave says

preceding::*[1] gives you the most recent preceding element

(ancestor::*|preceding::*)[1] gives you the first of the union of both node sets, in document order, namely the document element

so if you want to get the <preceding> element here

<ancestor>
  <preceding>I'm preceding<preceding>
  <node>I'm the context node</node>
</ancestor>

but the <ancestor> element here

<preceding>I'm preceding<preceding>
<ancestor>
  <node>I'm the context node</node>
</ancestor>

you have to do (ancestor::*|preceding::*)[last()]

Cheers,
Wendell


___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_ "Thus I make my own use of the telegraph, without consulting the directors, like the sparrows, which I perceive use it extensively for a perch." -- Thoreau


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.