Forum Discussion
Vijayata
16 years agoOccasional Contributor
The first hint and also from some help from Google, I could solve my own problem.
The way to loop through and get the guids is:
def myfile="""<Response>
<e>
<cloudClass>Some Class name</cloudClass>
<errorCode>503</errorCode>
<errorDescription>Some Error</errorDescription>
<guid>ca1f535d-cd9f-409d-a66c-4e2c6fdf4321</guid>
</e>
</Response>"""
// OR you this can be the response from one step
def response = new XmlSlurper().parseText(myfile)
response.e.each {
log.info "GUID :: $it.guid"
}
Thanks!!!
The way to loop through and get the guids is:
def myfile="""<Response>
<e>
<cloudClass>Some Class name</cloudClass>
<errorCode>503</errorCode>
<errorDescription>Some Error</errorDescription>
<guid>ca1f535d-cd9f-409d-a66c-4e2c6fdf4321</guid>
</e>
</Response>"""
// OR you this can be the response from one step
def response = new XmlSlurper().parseText(myfile)
response.e.each {
log.info "GUID :: $it.guid"
}
Thanks!!!