lets say I have the following XML
<InvoiceLines>
<InvoiceLine>
<InsertionDate>29.01.2015</InsertionDate>
<Productnbr>0102</Productnbr>
</InvoiceLine>
<InvoiceLine>
<InsertionDate>29.02.2015</InsertionDate>
<Productnbr>0103</Productnbr>
</InvoiceLine>
</InvoiceLines>
and I would like to get the insertion date of InvoiceLine that has Productnbr = 0103. If I would write xpath I would write somthing like:
//InvoiceLine[./Productnbr='0103']/InsertionDate
but I would like to use GPath since I am using XMLSlurper in my code. Is there a way how to apply predicate to GPath? Thank you
See Question&Answers more detail:os