I have the following document:
<a>
<bb>abc</bb>
<cc>ccc</cc>
<dd>ddd</dd>
</a>
<a>
<bb>zz</bb>
<cc>1</cc>
<dd>2</dd>
</a>
How can I get the value of <cc>
using XPath if <bb>
is zz
?
Not sure why everybody is querying for siblings, you can also check for <bb/>
-elements matching the predicate from <a/>
's predicate:
//a[bb/text() = "zz"]/cc/text()