So I'm following an example from another question, which I'll replicate here:
"Trying to select an element based on the value of one of it's children's children"
./book[author/name = 'John']
"Want all books where the author name = 'John'
Xml file"
<list>
<book>
<author>
<name>John</name>
<number>4324234</number>
</author>
<title>New Book</title>
<isbn>dsdaassda</isbn>
</book>
<book>...</book>
<book>...</book>
</list>
Now, for whatever reason, when I use the xpath above, it DOES select the book node, but it selects all of them, not just the one where author = John. Is there a reason why the xpath would be ignoring that and just pulling every book node?
I hope this makes sense. Thanks!
book
nodes? Your xpath looks ok - Aleh Douhi