I've parsed some html using XmlSlurper. Now I want to iterate all the children with a given element name.
What I've got now is the following code snippet
html.'**'.findAll { it.name() == 'a' }.each {
println it
}
It works but just isn't groovy enough. I would like to simply write something like this
html.'**'.a.each {
println it
}
If I do it this way, GPath complains that there is no property with name 'a'. Any idea if there is an easy syntax to formulate this iteration?