If i have my GPath like this:
<Apple>
<Mango>
<id>5 </id>
</Mango>
<Mango>
<id>10 </id>
</Mango>
</Apple>
To get a Mango which has an id of 5, i would do,
GPathResult result = Apple.find{
it.Mango.id=5
}
But If my GPath was recursive. I mean, an apple can have a mango. And a Mango can again have an apple in it. For ex:
<Apple>
<Mango>
<id>10</id>
<Apple>
<Mango>
<id>5 </id>
</Mango>
</Apple>
</Mango>
</Apple>
How do I get the mango with an id of '5'. However recursive, the GPath might be(Mango with id '5' can be in any level of recursion), I need to find for mango with id of '5'. How can I achieve this with a find closure?
Advance Thanks