How can I get an element in Xpath using complex condition?
For example:
<?xml version="1.0" encoding="UTF-8"?>
<stock xmlns="http://localhost/aaabbb">
<item item-id="1">
<name xml:format="short">This is a short name</name>
<name xml:format="long">This is a LONG name</name>
</item>
</stock>
Target: to get the text of the tag WHERE xml:format=”long”.
Thanks in advance for your help!
Take a look at this: http://www.w3schools.com/xpath/xpath_syntax.asp. The example you are requesting:
The XML document:
The XPATH:
So you should do this: