Below is an example XML. I would like to retrieve the 'root node tag'.
- I would like to retrieve the text "Personnel" from the XML below. How do I achieve that using XPATH?
- How to retrieve the text "Age" when the age=34 using XPATH. No matter what I try I am getting only the value (i.e. '34') and not the tag (i.e. 'Age'). Please note that I would like to retrieve only the tag(i.e. 'Age') and not the 'value'('34').
Please help me this.
<Personnel>
<Employee type="permanent">
<Name>Seagull</Name>
<Id>3674</Id>
<Age>34</Age>
</Employee>
<Employee type="contract">
<Name>Robin</Name>
<Id>3675</Id>
<Age>25</Age>
</Employee>
<Employee type="permanent">
<Name>Crow</Name>
<Id>3676</Id>
<Age>28</Age>
</Employee>
</Personnel>