4

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>
1
  • Do note tha /entries/entry/key='test' it's an existencial comparison. I should return true or false Commented Feb 10, 2011 at 18:47

1 Answer 1

5

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']
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.