XML Parsing in Groovy strips attribute new lines
- by Bill James
I'm writing code where I retrieve XML from a web api, then parse that XML using Groovy. Unfortunately, it seems that both XmlParser and XmlSlurper for Groovy strip newline characters from the attributes of nodes when .text() is called.
How can I get at the text of the attribute including the newlines?
Sample code:
def xmltest = '''…