I need to extract (using Java) the tag for the given name tag from XML file like this:
Here is my XML file:
<aa>
<bb>
<name>k1</name>
<value>5</value>
</bb>
<bb>
<name>k2</name>
<value>7</value>
</bb>
</aa>
Input to function: full path to <name> tag, e.g.: /aa/bb/name=k2
( Output for this example should return 7)
Also more advanced question: I need to extract all name:value pairs from the XML file then the name is given by regular expression I am thinking that XPath is the right tool here, but devil in details.