While trying to parse RSS feeds in Groovy, I found a GPath example using wildcards:
def text = """
<data>
<common-tables>
<table name="address"/>
<table name="phone"/>
</common-tables>
<special-tables>
<table name="person"/>
</special-tables>
<other-tables>
<table name="business"/>
</other-tables>
</data>
"""
def xml = new XmlParser().parse(new ByteArrayInputStream(text.getBytes()))
def tables = xml.'**'.table.findAll{ it.parent().name() ==
"special-tables" || it.parent().name
(from http://old.nabble.com/Q:-Avoiding-XPath---using-GPath-td19087210.html)
It looks like a funny use of the 'spread-dot' operator. I can't find any reference to this on the Groovy site, books, etc.
How does this work, and more importantly, how do you discover this? Is there any XPath to GPath 'Rosetta Stone' out there?