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)
The problem being that I ran into a bug in the groovy version (2.2.2.) that I use in my application the only reasonable conclusion is to upgrade to a version in which the bug is corrected. Thus, the solution is upgrading to the latest groovy (2.3.6) and grails (2.4.3)
An alternative solution would be to use XmlParser instead of XmlSlurper, which is what I presently use.
I also had to upgrade from JDBC3 to JDBC4.
And, finally, when the company moves from Ubuntu 12.04 to Ubuntu 14.04, I will upgrade to Postgresql 9.3.5
All these upgrades were already planned to eventually happen but the groovy bug forced the pace and we took longer steps, skipping som intermediate versions.