Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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
Try: bookstore//title
bookstore//title
// means any child (including grandchildren) named title
//
title
By the way, you didn't close off the book elements.
Add a comment
Another option would be:
bookstore/*/title
Required, but never shown
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.
Explore related questions
See similar questions with these tags.