Finding xml element value case insensitive using XmlSlurper/GPath?

sahil3x1

New Member
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:\[code\]<start> <Header> <Elem>1234</Elem> </Header></start>\[/code\]Getting the value of Elem will be:\[code\]def parsedXml = new XmlSlurper().parseText(xml)parsedXml.Header.Elem\[/code\]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?\[code\]<start> <header> <elem>1234</elem> </header></start>def parsedXml = new XmlSlurper().parseText(xml)parsedXml.header.elem\[/code\]
 
Back
Top