[xquery-talk] and/or searches

Priscilla Walmsley pwalmsley-lists at datypic.com
Tue Apr 19 21:28:49 PDT 2005


Hi Cindy,

It looks like you are using "and" as a kind of union operator for node
sequences, which will not work.  Instead of "and", you want to use "union"
or "|".  

Hope that helps,
Priscilla

-----------------------------------------------------
Priscilla Walmsley             priscilla at walmsley.com
Author, Definitive XML Schema     (Prentice Hall PTR)
        Definitive XQuery (coming in 2005)
-----------------------------------------------------  

> -----Original Message-----
> From: talk-bounces at xquery.com 
> [mailto:talk-bounces at xquery.com] On Behalf Of Cindy Girard
> Sent: Tuesday, April 19, 2005 11:18 AM
> To: talk at xquery.com
> Subject: Re: [xquery-talk] and/or searches
> 
> I have the following code:
> 
> for $entries in collection($collctn)//TEI.2/text[contains(., 
> $keyword1)]
> return
>  concat ("for $entries in collection('", $collctn, 
> "')//TEI.2[. &= '*", $keyword1, "*']
>    and collection('", $collctn, "')//TEI.2[. &= '*", 
> $keyword2, "*']",
>  " return <doc>{$entries//TEI.2/@n, $entries//TEI.2/@id, 
> $entries//TEI.2/text/@type, $entries//text//head[1]}</doc>")
> 
> 
> And I get the following error:
> XMLDBException occurred: cannot convert value of type 
> xs:boolean to a node set
> 
> 
> I understand the error, but not where it applies. Is it obvious to
> everyone else?  I'm still learning
> xquery - any pointers to good documentation or samples would be
> appreciated.
> 
> Thanks,
> Cindy
> 
> 
> CG> Hi,
> 
> CG>   Does anyone have samples of simple keyword searches 
> that they'd be
> CG>   willing to share using 'and' and 'or?'
> 
> CG>   I can't seem to get mine working.
> 
> CG>   Thanks,
> 
>   
> 
> CG> ----- 
> CG> - Cindy  
> 
> CG> Cynthia M. Girard
> CG> IATH, University of Virginia
> CG> clm6u at virginia.edu
> 
> CG> "Danger? I laugh in the face of danger!
> CG> ...and then I hide until it goes away."
> 
> CG> _______________________________________________
> CG> talk at xquery.com
> CG> http://xquery.com/mailman/listinfo/talk
> 
> 
> 
> -- 
> - Cindy 
> 
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
> 




More information about the talk mailing list