Please help me to solve the following issue in dom4j
This is my xml file:
<root>
<variant>
<name>first</name>
<values>
<name>first_element</name>
</values>
</variant>
<variant>
<name>second</name>
<values>
<name>second_element</name>
</values>
</variant>
</root>
I used following java code to get the variant node.
root.selectNodes("\root\variant");
This is giving me the list count as 2. I am using list to collect each node individually. from list nodes I am iterating. I used to following code to get the value "values\name".
variant.selectNodes("\\values\name");
I am getting both the values "first_element and second_element". could any one help me to get one values of the current node.