1

How can I get the values of all nodes called "title" from the XML below ?

<bookstore>
<bookA>
 <title> Title Book A</title>
 <desc> Book A </desc>
<bookA>

<bookB>
 <title> Title Book B</title>
 <desc> Book B </desc>
<bookB>
</bookstore>

Thanks

0

2 Answers 2

4

Try: bookstore//title

// means any child (including grandchildren) named title

By the way, you didn't close off the book elements.

Sign up to request clarification or add additional context in comments.

Comments

1

Another option would be:

bookstore/*/title

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.