Torsten,<br><br>thanks a lot<br><br>Billigo<br><br><div><span class="gmail_quote">On 8/29/06, <b class="gmail_sendername">Torsten Grust</b> <<a href="mailto:grust@in.tum.de">grust@in.tum.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Following up on myself, the slightly modified<br><br> //b[*/text()/tokenize(.," ") = ("kiwi","banana")]<br><br>should be more stable with respect to spurious white space in the sub-
<br>trees below b elements.<br><br> --Torsten<br><br>On Aug 29, 2006, 10:44 AM, Torsten Grust wrote with possible deletions:<br>> Hi,<br>><br>> does<br>><br>> //b[*/tokenize(.," ") = ("kiwi","banana")]
<br>><br>> solve your problem? (It behaves as desired for the two cases you<br>> give below.)<br>><br>> Cheers,<br>> --Torsten<br>><br>> On Aug 29, 2006, 10:18 AM, yix yix wrote with possible deletions:
<br>>> 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<br>>> "banana", but I want to exclude the first b (with n="1") because<br>>> the keywords are not in its own content (c+d), but in its b
<br>>> 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>>> <e>kiwi banana</e><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<br>>> _______________________________________________
<br>>> <a href="mailto:talk@x-query.com">talk@x-query.com</a><br>>> <a href="http://x-query.com/mailman/listinfo/talk">http://x-query.com/mailman/listinfo/talk</a><br>><br>> --<br>> | Prof. Dr. Torsten Grust
<a href="mailto:grust@in.tum.de">grust@in.tum.de</a> |<br>> | <a href="http://www-db.in.tum.de/~grust/">http://www-db.in.tum.de/~grust/</a> |<br>> | Database Systems - Technische Universität München (Germany) |
<br>><br>><br>><br>><br>><br>> _______________________________________________<br>> <a href="mailto:talk@x-query.com">talk@x-query.com</a><br>> <a href="http://x-query.com/mailman/listinfo/talk">http://x-query.com/mailman/listinfo/talk
</a><br>><br><br>--<br> | Prof. Dr. Torsten Grust <a href="mailto:grust@in.tum.de">grust@in.tum.de</a> |<br> | <a href="http://www-db.in.tum.de/~grust/">http://www-db.in.tum.de/~grust/
</a> |<br> | Database Systems - Technische Universität München (Germany) |<br><br><br><br><br></blockquote></div><br>