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

selecting nodes based on a descendant property

Subject: selecting nodes based on a descendant property
From: "Robert P. J. Day" <rpjday@xxxxxxxxxxxxxx>
Date: Tue, 11 Mar 2003 03:46:46 -0500 (EST)
xpath descendant
  i'm working my way through john simpson's "xpath and xpointer"
book from o'reilly, and i have a question.

  as an exercise (p. 106-9 for those who have the book), simpson
starts by asking to find all "sign" elements that have a "part"
descendant whose name (that is, text() value) ends with "s".

  to get the latter, he starts with

  //part[substring(., string-length(.), 1) = "s"]

and to then select all "sign" ancestors of this node set, he appends

  //part[substring(., string-length(.), 1) = "s"]/ancestor::sign


  it seems that a much clearer way would be to use

  //sign[descendant::part[substring(., string-length(.), 1) = "s"]

i'm testing a variation of this on his sample file using "xpathtester",
and it *seems* to give me the same result, as well as being (to me
at least) more intuitive.

  does this really correspond to the same node set?  or is there
something subtle here i'm not seeing?

rday


 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.