Find element all of whose children have a given value
- by cru3l
for example, i have this xml
<elements>
<a>
<b>6</b>
<b>5</b>
<b>6</b>
</a>
<a>
<b>5</b>
<b>5</b>
<b>6</b>
</a>
<a>
<b>5</b>
<b>5</b>
<b>5</b>
<b>5</b>
</a>
</elements>
i need a xpath query, which must return me parent tag, only if all its children are equal to 5 (a[3] in this case).
Something like that
//b[text()="5"]/..
but with check of all children's tags. Please note that number of children tags can be different from node to node.
It's possible with only xpath query?
thanks