Groovy web console

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

extract attribute xml

Published 6 months ago by nmrao with tags xml
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def xml = """<beans xmlns:jee="http://example">
    <jee:jndilookup jndi-name="" id="tenantDataSourceJndi" />
</beans>"""
pXml = new XmlSlurper().parseText(xml)
println pXml.'**'.find{it.name() == 'jndilookup'}.@id