evoks
8 years agoOccasional Contributor
GroovyScript: Getting node name, sub node names and its values in array from XML
Hi all,
Could you help me please ?
I have an XML file like this :
<parent>
<node1>value1</node1>
<subnode>
<subnode1>subnode_value1</subnode1>
<subnode1>
<node2>value2</node2>
<node3>value3</node3>
</parent>
Is there a way to get node name, subnode names and his associated value in an array ?
Output example :
array1 return : [node1, subnode1, node2, node3]
and array2 return : [value1, subnode_value1, value2, value3]
If I get this kind of output, I could work with indexes and compare easily some datas.
Many thanks for your future help.
Regards.
Hi,
Please find the solution on this topic :
BR,
Anthony.