What is the full syntax of Groovy's GPath expressions? -


While attempting to parse RSS feeds in Groovy, I found a GPath example to use wildcards:

  deft text = "& table> table name =" person "/> gt; special-tables & gt; other tables & gt; table name =" business "/> And & lt; / other-tables & gt; & lt; / data & gt; "def xml = new XMLPers () .pars (new bytereinterstream (text.getbits ())) def table = EX SML. '**'. Table.find all {this peeper () .name () == "special-table" || it. () .name  

(to) < / P>

This looks like a strange use of 'spread-dot' operator. I can not find any reference to Groovy site, books etc.

How it works More importantly, how do you find it? Is there any XPath for GPath 'Rosetta Stone'?

OK, as always, the best place to know Groovy is only in the source to get.
The result of a parsing is a groove.tele slurpersupport.GPathResult object.

If you look at the source (plain Java file), you will see that the getProperty (string) method has the following special operators:

  • ".."
  • "*" which gives to all children
  • "**" which acts as a loop before depth
  • "@ "Which is used to use a property
  • Normal node accessor.

All this, there is no other magic keyword for the moment.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -