Uri Moszkowicz
added a comment - 03/May/12 12:25 I've used it in a few ways. One is to gather up a list of @name attributes for all nodes leading up to one so that it can be uniquely identified. Another is to inherit attributes from ancestor nodes.

Your use cases make sense. There is a little bit of complication with how XmlSlurper defines parent() which is why there is currently no implementation for parents(). For DOMCategory and XmlParser, parent() means walk up the "DOM" tree one level. For XmlSlurper, it means unravel one level of GPathResult. If you have a GPath expression walking down the XML nodes, it amounts to the same thing but that is not always the case with GPath expressions.

Paul King
added a comment - 13/May/12 04:46 Your use cases make sense. There is a little bit of complication with how XmlSlurper defines parent() which is why there is currently no implementation for parents(). For DOMCategory and XmlParser, parent() means walk up the "DOM" tree one level. For XmlSlurper, it means unravel one level of GPathResult. If you have a GPath expression walking down the XML nodes, it amounts to the same thing but that is not always the case with GPath expressions.