// inside a predicate behaves like /descendant:: ???
Posted: Wed Jun 17, 2009 12:51 pm
I this a bug or a feature of xpath?
the following xpath:
on the following XML:
returns 3 nodes instead of just the one.
to get the result I want I need to use
I though was equivalent to but inside a predicate it seems to be equivalent to
Have I missed something?
PS: example kept deliberately simple: please do not tell me I do not need // to get what I want
the following xpath:
Code: Select all
/A/B[//C='want']
Code: Select all
<A>
<B><C>don't want</C></B>
<B><C>want</C></B>
<B><C>don't want</C></B>
</A>
to get the result I want I need to use
Code: Select all
/A/B[descendant::C='want']
Code: Select all
//
Code: Select all
descendant::
, i.e. select descendant nodes of the root element??/descendant::
Have I missed something?
PS: example kept deliberately simple: please do not tell me I do not need // to get what I want
