Groovy web console

subscribe to the feed Subscribe
to this
site
xmlTest (via #groovywebconsole)
tweet this snippet Tweet
this
script

xmlTest

Published 4 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def data = "<list><orderNo>000003313</orderNo><orderNo>000003314</orderNo><orderNo>000003315</orderNo><orderNo>000003316</orderNo><orderNo>000003318</orderNo><orderNo>000003334</orderNo><orderNo>000003335</orderNo><orderNo>000003336</orderNo><orderNo>000003301</orderNo><orderNo>000003302</orderNo><orderNo>000003303</orderNo><orderNo>000003304</orderNo><orderNo>000003305</orderNo><orderNo>000003306</orderNo><orderNo>000003307</orderNo><orderNo>000003308</orderNo><orderNo>000003309</orderNo><orderNo>000003310</orderNo><orderNo>000003311</orderNo><orderNo>000003312</orderNo></list>"

def pXml = new XmlSlurper().parseText(data)
pXml.orderNo?.each {

    println it
}