Reputation: 350
When doing something like /entries/entry/key='test'
, I always get the node key returned.
But I want the entry node. How can I get it?
My XML looks like this:
<entries>
<entry>
<key>test</key>
</entry>
</entries>
Upvotes: 4
Views: 252
Reputation: 3233
You want to select the entry node and match subelement "key"'s value to the text 'test' . This should do it:
/entries/entry[key='test']
Upvotes: 5