Hi there,
I am trying to quickly find the parent and child nodes of a node with a particular contents value.
Like from the sample xml below I'd like to find the parent+child nodes for the contents 'Computer'. I would expect to find books/store[0]/book[0]/genre
Is there any way of doing this? I don't know what to look for on google.
Sample XML:
<books>
<store id="01">
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
</book>
</store>
I am trying to quickly find the parent and child nodes of a node with a particular contents value.
Like from the sample xml below I'd like to find the parent+child nodes for the contents 'Computer'. I would expect to find books/store[0]/book[0]/genre
Is there any way of doing this? I don't know what to look for on google.
Sample XML:
<books>
<store id="01">
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
</book>
</store>