Very good, I currently have the following xml file (person.xml)
Jane Smith 31 Juan Smith 31 In the process that I am doing, I know what the value of var will be and what I need to obtain is the value of "firstName"
The first query I was preparing was:
def person = new XmlParser().parse(new File("/tmp/person.xml"))
println "first name: ${people.person[0].firstName.text()}"
The funny thing that people do not recognize it groovy.lang.MissingPropertyException: No such property:
If both in the xml remove the tag people, the previous query works.
If I try to launch the query
println "first name: ${person.@var=='hola'.firstName.text()}"
I see the same error above groovy.lang.MissingPropertyException: No such property:
How should I launch the query so that given the value of "var" I can get the value of firstName?
greetings Javi