0
votes

I have a scenario where i need to take parent node x ml using two child node values example

<books>
<book>
<id>3</id>
<name>sai</name>
</book>
<book>
</book>
<book>
</book>

</books>

what I need to do is select the book X ML which has the matching child nodes i tried with this approach it is not working //id[text(),'1'] and name[text(),'sail']/..

1

1 Answers

0
votes

You can try the following

//books/book[id=3 and name='sai']