Hi Damon,

It works for me. Thanks.

Helen

From: Damon Feldman 
<[email protected]<mailto:[email protected]>>
Reply-To: 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Mon, 14 Mar 2011 08:43:53 -0700
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] question about cts:query

Helen,

Use:

cts:element-query( xs:QName("ns:mytag"), cts:and-query(()) )

The empty sequence passed to an and-query evaluates like "true."

Damon
________________________________
From: 
[email protected]<mailto:[email protected]>
 
[[email protected]<mailto:[email protected]>]
 On Behalf Of Helen Chen [[email protected]<mailto:[email protected]>]
Sent: Monday, March 14, 2011 11:35 AM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] question about cts:query

Hello there,

I think I sent this message to the wrong email last time, so I'm resending it.

I have a query like the following:


let $and-evq := cts:and-query((cts:element-value-query(fn:QName("ns","coden"), 
"AA", ("case-insensitive")),
                               cts:element-value-query(fn:QName("ns","volume"), 
"97", ("case-insensitive")),
                               cts:element-value-query(fn:QName("ns","issue"), 
"1", ("case-insensitive"))),())
return
   for $d in  cts:search(fn:doc(), $and-evq)
   return
   fn:base-uri($d)



Now I need to add another query into $and-evq to say like:  the element 
fn:QName("ns","mytag")  exists.  I don't have the value for mytag to match, I 
just want to make sure there is a element called "mytag" in the xml file.  I 
see a lot of APIs for value match, but not sure how I can check if an element 
exists.  Or is there any other ways to do it?  This is for real time search.


I'm using marklogic 4.1.


Thanks, Helen


_______________________________________________ General mailing list 
[email protected]<mailto:[email protected]> 
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to