I am parsing a piece of XML using XmlSlurper and need to find an xml elements value. The challenge in this is that i am not always sure if the casing in the xml document will be correct, so i need to find the element in any possible way.
Example:
<start>
<Header>
<Elem>1234</Elem>
</Header>
</start>
Getting the value of Elem will be:
def parsedXml = new XmlSlurper().parseText(xml)
parsedXml.Header.Elem
but i also need to find it when the casing is different.. so is there a way in which i can express to find the value of Elem when the casing is different?
<start>
<header>
<elem>1234</elem>
</header>
</start>
def parsedXml = new XmlSlurper().parseText(xml)
parsedXml.header.elem