Reputation: 944
If I have the xml document
<A>
<B>TEXT</B>
<C>
<D>1</D>
<E>2</E>
</C>
<C>
<D>3</D>
<E>4</E>
</C>
</A>
Is it possible in a single xpath to get all values of A/C/D if the value of <B>
is TEXT and select nothing if it is any other value?
Upvotes: 1
Views: 38
Reputation: 167436
The path /A[B = 'TEXT']/C/D
selects the two D
elements in your sample.
Upvotes: 3