David,

I realize I'm a little late with my answer, but just to throw another option 
into the pool, did you consider getting rid of the cts:search completely?  That 
is, if I were doing something like this, I would be inclined to do it entirely 
with XPath:

fn:doc("doc")/doc[name="Sub Part"]

I realize your real query is probably significantly more complex than your 
example, but it's just another idea to consider.

Doug Glidden
Software Engineer
The Boeing Company
[email protected]


  _____

From: [email protected] 
[mailto:[email protected]] On Behalf Of Lee, David
Sent: Monday, December 21, 2009 08:16
To: [email protected]
Subject: [MarkLogic Dev General] How to get cts:element-value-query() to 
notdecend to the depths of Hades



I have a XML doc (not my own design) something like

<doc>

   <name>Title</name>

   <part>

       <name>Part</name>

       <subpart>

            <name>Sub Part<name>

    </subpart>

   </part>

  ...



</doc>





I want a cts:search  query that will match <name>Title</name> but not <name>Sub 
Part<name> or other names.



cts:search( doc("doc")/doc , cts:element-value-query( xs:QName("name") , "Sub 
Part")  )



matches when I do not want it to.   How can I restrict cts:element-value-query 
from matching descendant  nodes ?

I looked at adding an and-not-query but that wont work because its possible for 
multiple name elements to have the

same value and I dont want a match discarded just because it matched in 
multiple places.



Any suggestions ?













----------------------------------------

David A. Lee

Senior Principal Software Engineer

Epocrates, Inc.

[email protected]<mailto:[email protected]>

812-482-5224





_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to