Subject: Re: [xsl] is there really a need for location steps of ".."? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 12 Mar 2003 11:21:03 -0500 |
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?
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] is there really a need for lo, Robert P. J. Day | Thread | Re: [xsl] is there really a need fo, Robert P. J. Day |
RE: [xsl] dynamic XPath?, Yue Ma | Date | Re: [xsl] is there really a need fo, Robert P. J. Day |
Month |