Hi,<br><br><br>My input document looks like that :<br><br><a><br> <b n="1"><br> <c>pea</c><br> <d>apple</d>
<br> <b n="2"><br> <c>kiwi</c><br> <d>banana</d><br> </b><br> </b><br> <b n="3"><br> <c>kiwi</c>
<br> <d>banana</d><br> </b><br></a><br><br>The structure is recursive : b can contain b.<br><br>I
want to write a query to retrieve any b that contains "kiwi" and
"banana", but I want to exclude the first b (with n="1") because the
keywords are not in its own content (c+d), but in its b child's
content.
<br>The query should return b2 and b3.<br><br>This query can't go :<br><br>for $x in //b<br>where $x[contains(., "kiwi") and contains(., "banana")]<br>and not($x/c[contains(., "kiwi") and contains(., "banana")])
<br>return $x<br><br>because, sometimes my put could be :<br><br><a><br> <b n="1"><br> <c>pea</c><br> <d>apple</d><br> <b n="2"><br>
<c>kiwi</c><br> <d>banana</d><br> </b><br> <span style="font-weight: bold;"><e>kiwi banana</e></span><br> </b><br> <b n="3">
<br> <c>kiwi</c><br> <d>banana</d><br> </b><br></a><br><br>In that case, the query should return all three b.<br><br>Thanks for your help,<br><br>Billig