Привет
Можно немного упростить it.toString().contains('Chocolate'), заменив его на it=~'Chocolate'
В итоге получим: xmlPath.getString("shopping.category.staff.find{ it=~'Chocolate' }.price");
Премного благодарен!
Вообще Gpath очень интересно! Правда я некоторые вещи из Xpath не могу спроецировать на Gpath, ибо там законы немного другие, right?
GPath is a path expression language integrated into Groovy which allows parts of nested structured data to be
identified. In this sense, it has similar aims and scope as XPath does for XML. GPath is often used in the context of
processing XML, but it really applies to any object graph. Where XPath uses a filesystem-like path notation, a tree
hierarchy with parts separated by a slash /, GPath use a dot-object notation to perform object navigation.