Created
June 3, 2014 22:13
-
-
Save james-prickett/aa83ca6c0cbc181983a9 to your computer and use it in GitHub Desktop.
Groovy XmlSlurper Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def person = new XmlSlurper().parse("/home/james/person.xml") | |
| assert person.name == "John Doe" | |
| assert person.phone == "555-5555" | |
| assert person.address[0].street == "5 Somewhere Lane" | |
| assert person.address.find { it.@type.text().contains("home") }.street == "5 Somewhere Lane" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment