XPath to select element based on childs child value returning multiple values?

sheltonyonder

New Member
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"\[code\]./book[author/name = 'John']\[/code\]"Want all books where the author name = 'John'Xml file"\[code\]<list> <book> <author> <name>John</name> <number>4324234</number> </author> <title>New Book</title> <isbn>dsdaassda</isbn> </book> <book>...</book> <book>...</book></list>\[/code\]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!
 
Back
Top