Please refer the sample XML below
<Actions>
<Action>
<Name>Forward</Name>
<Value>Forward Assignment</Value>
<panelID>Y0192_pnlForwad</panelID>
<Status>Order Suspended</Status>
<from>Shop</from>
<to>Warehouse</to>
</Action>
</Actions>
If I know the value of “from” node, how can I determine the corresponding value of “Name” and “Value” node using an XPath expression?
Use:
This selects any element named
Nameor namedValue, whose parent is anActionchild of the top element of the XML document, and (theActionparent) has afromchild, whose string value is the string"Shop".If you want the
NameandValueselected (not together but) individually, this can be done evaluting two XPath expressions:and