[MarkLogic Dev General] need help with cts:element-query

Geert Josten geert.josten at dayon.nl
Tue Jan 24 14:20:18 PST 2012


Hi Gary,



You are matching an exact value, why not use cts:element-value-query? You
are effectively using cts:word-query wrapped inside a cts:element-query..



Kind regards,

Geert



*Van:* general-bounces at developer.marklogic.com [mailto:
general-bounces at developer.marklogic.com] *Namens *Gary Larsen
*Verzonden:* dinsdag 24 januari 2012 23:13
*Aan:* 'General MarkLogic Developer Discussion'
*Onderwerp:* [MarkLogic Dev General] need help with cts:element-query



There is an <active> element which contains a <value> where the text can
only be true or false:



<content xmlns="http://developer.envisn.com/xmlns/envisn/netvisn/">
  <components>
    <ContentImpl>
      <components/>
      <crnData8>
       <active>
         <value>false</value>
       </active>

Using this cts:query will return documents with values of either true or
false:



                cts:element-query(xs:QName('active'), 'true')



though when the cts:search is ‘filtered’ the correct data is returned



I’m trying to avoid defining a field and was hoping this syntax would work,
but the query needs to run ‘unfiltered’



Thanks for any help.



gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20120124/9f83b831/attachment.html 


More information about the General mailing list