iterating over xml file from top to bottom with groovy

devilmafia

New Member
I have a xml file, which represents a simple "script" where specific elements represents different commands.I want to use groovy to parse and "interpret" the xml file.How can i iterate over the nodes of the xml file.I am using the xmlSlurper class to parse my xml file:\[code\]def records = new XmlSlurper().parse("./script.xml")\[/code\]Now i need to iterate over the elements from top to bottom and run some groovy code...just an example file:\[code\]<script> <do> echo :) </do> <for from="0" to="3"> <do> echo hello </do></for></script>\[/code\]
 
Back
Top