Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/XML-XPath/Groovy/xml-xpath.groovy
Normal file
4
Task/XML-XPath/Groovy/xml-xpath.groovy
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
def inventory = new XmlSlurper().parseText("<inventory...") //optionally parseText(new File("inv.xml").text)
|
||||
def firstItem = inventory.section.item[0] //1. first item
|
||||
inventory.section.item.price.each { println it } //2. print each price
|
||||
def allNamesArray = inventory.section.item.name.collect {it} //3. collect item names into an array
|
||||
Loading…
Add table
Add a link
Reference in a new issue