I'm trying to retrieve all <t>
nodes in the following expression:
<x>
<t>10
<s>,14,14,16,</s>
</t>
<t>12
<s>,14,14,16,</s>
</t>
<t>14
<s>,14,14,16,</s>
</t>
<t>14</t>
</x>
The condition is such that the child node should contain the text from <t>
. Therefor I tried the following:
//t[.//*[contains(., ',')]]
This nicely retrieved all <t>
nodes where the descendant contained a comma. However I wanted to refer back to it's parent. Effectively looking like: //t[.//*[contains(., concat(',', /.., ','))]]
. However this returns no matches.
Obviously I'm doing something wrong here. My expected result is only 14
. Is it possible to make a reference to descendants and another back to it's parent? If so, what is the right syntax?