XPath status returns an "invalid" node

When you do something like /entries/entry/key='test' , I always get the returned key node. But I want a node entry. How can i get it?

My XML looks like this:

 <entries> <entry> <key>test</key> </entry> </entries> 
+4
source share
1 answer

You want to select the node entry and match the value of the key subelement with the text test. This should do it:

 /entries/entry[key='test'] 
+5
source

Source: https://habr.com/ru/post/1339258/


All Articles