In my xml file, that I read from a URL using
def inp = url.openStream(...)
def slurper = new XmlSlurper()
def xml = slurper.parse(inp).declareNamespace(xml:'http://www.w3.org/XML/1998/namespace')
I have
<course xmlns="http://www.kth.se/student/kurser" code="DD2471">
<title xmlns="" xml:lang="sv">Moderna databassystem</title>
<title xmlns="" xml:lang="en">Modern Database Systems</title>
and I extract the titles with groovy 1.8.6 by
def name = xml.title.find{ it.@':lang' == 'sv' }.text()
But when upgrading to groovy 2.2.2 I no longer get the swedish title just an empty string and I can't figure out how to extract the title. I want to find a method that works in all groovy versions (or >= 1.8.6)