Re: [bdbxml] Query problem
Adam Rambousek <[email protected]> Tue, 16 Aug 2005 23:11:40 +0200
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
> The first parameter passed to contains(), starts-with() etc.must either be
> a string or be a sequence containing zero or one items, which can be
> silently cast to a string (or the empty string in the case of the empty
> sequence.) So if in your target document SYNONYM/LITERAL evaluates to a
> single node you are OK. But if it evaluates to a sequence of more than one
> nodes you will get the error you describe. The remedy is to use a suitable
> predicate to restrict the return sequence to a single member, or rethink
> your query strategy so it is never applied when the context node has several
> SYNONYM/LITERAL descendants. E.g you could gather all the nodes into a
> variable and iterate over them with a FLOWR expression, applying contains()
> to each node in turn.
Thank you very much, with your hint, I found a correct query.
If anynone is interested, it should be like this:
for $x in collection('database')/SYNSET where some $p in
$x/SYNONYM/LITERAL satisfies (contains($p,'searched word')) return $x
--
Adam Rambousek
email: [email protected] www: http://www.pohadkovychlum.cz
*People should not be afraid of their governments.
Governments should be afraid of their people. - V for Vendetta
------------------------------------------
To remove yourself from this list, send an
email to [email protected]