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

is there really a need for location steps of ".."?

Subject: is there really a need for location steps of ".."?
From: "Robert P. J. Day" <rpjday@xxxxxxxxxxxxxx>
Date: Wed, 12 Mar 2003 09:25:52 -0500 (EST)
 is there really a need for location steps of ".."?
  a number of examples in the xpath books and tutorials i'm reading
seem to enjoy showing examples involving ".." as one of the location
steps, or some operation involving "backing up".  as one example, 
simpson's book "XPath and XPointer":

  //part[. = "Hands"]/ancestor::*

sure, i can see that this represents the node-set of all ancestors
of all part elements whose string value is "Hands".

  but it seems that this expression is equivalent:

  //*[descendant::part = "Hands"]	# appears to mean the same

one obvious difference, admittedly, is that the first expression
will generate a node-set in order going up, while the second will
work its way down from the root.

  other than that, are these equivalent?  more to the point, 
it seems that most location paths can be rewritten to get rid
of this kind of "backing up" idea.  and is efficiency an issue
here?  or does it not matter all that much?

  just curious how others see this.

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.