I want to iterate over the nodes of an XML file using an XML-Holder.
def reader = groovyUtils.getXmlHolder(test1 );
let's say the XML looks like this:
<xml> <node> <val1/> <val2/> </node1> <node> <val1/> <val2/> </node2> </xml>
I want to read values โโfrom different nodes. (val1, val2). So I tried like this:
for( node in reader.getNodeValues( "//ns1:node" )) {}
It really does iterate over the nodes, but I don't know how to access the values โโinside them.
Many thanks for your help!
John
source share