|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Union and Intersect Operators=?GB2312?B?1dTA1w==?= zhaolei at gmail.comSat Mar 15 10:12:16 PST 2008
In your second query, "intercept" should be "intersect"? Union is functioned on nodes. And two nodes nodeA and nodeB are duplicates only if they satisfy "nodeA is nodeB". In the xpath expression, tags <head>, <p>, <note> and <address> locate different nodes, which are not duplicates. Thus "union" gives all of them, and "intersect" gives none. Regards, Lei On 3/15/08, Wei, Alice J. <http://x-query.com/mailman/listinfo/talk> wrote: > Hi, > > I have a strange output here from the web application using xquery. I intend to use the union operator here to combine all the results of the possible tags I intend to run search against, but it turned out that the $count variable below, which the similar XPath has been used to call the function as well for the query, does not exclude duplicates. What it appears to do is giving me all the tags that contain the the phrase $search to my query > > let $search := upper-case(request:get-parameter("search", "")) > let $count := count(collection("xmldb:exist://db/cbml")//ad/((head union p) union (note union //address))[contains(upper-case(.),$search)]) > > When I used > > let $count := count(collection("xmldb:exist://db/cbml")//ad/((head union p) intercept (note union //address))[contains(upper-case(.),$search)]) > > it gives me no output. > > However, the first line I had, it gives me back as many times the phrase $search has been used in the four parameters. > If anyone needs to see more of my query, I would love to provide it, but the query itself is very long. > > Can anyone please give me tips on what might have gone wrong here? > > Thanks to those who can help. > > Alice > ====================================================== > Alice Wei > MIS 2008 > School of Library and Information Science > Indiana University Bloomington > http://x-query.com/mailman/listinfo/talk > > _______________________________________________ > http://x-query.com/mailman/listinfo/talk > http://x-query.com/mailman/listinfo/talk >
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
Winners and finalists announced at SOA World Conference in November. 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
|







