|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] query on recursive xml structureyix yix billigo at gmail.comTue Aug 29 11:18:18 PDT 2006
Hi,
My input document looks like that :
<a>
<b n="1">
<c>pea</c>
<d>apple</d>
<b n="2">
<c>kiwi</c>
<d>banana</d>
</b>
</b>
<b n="3">
<c>kiwi</c>
<d>banana</d>
</b>
</a>
The structure is recursive : b can contain b.
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.
The query should return b2 and b3.
This query can't go :
for $x in //b
where $x[contains(., "kiwi") and contains(., "banana")]
and not($x/c[contains(., "kiwi") and contains(., "banana")])
return $x
because, sometimes my put could be :
<a>
<b n="1">
<c>pea</c>
<d>apple</d>
<b n="2">
<c>kiwi</c>
<d>banana</d>
</b>
<e>kiwi banana</e>
</b>
<b n="3">
<c>kiwi</c>
<d>banana</d>
</b>
</a>
In that case, the query should return all three b.
Thanks for your help,
Billig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20060829/4061af89/attachment.htm
|
Purchase Stylus Studio Online Today!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






