For starters, it looks like the first query is searching on this: //xhtml:html/xhtml:head/xhtml:meta/fwp:divisions
and the second query is searching on this: /xhtml:html/xhtml:head/fwp:divisions If you remove the xhtml:meta step in the first one does it return what you expect? -Danny From: [email protected] [mailto:[email protected]] On Behalf Of Singh, Gurbeer Sent: Wednesday, October 03, 2012 1:48 PM To: [email protected] Subject: [MarkLogic Dev General] A question on cts:search Hi, Strange behaviors of cts:search I am running below query but not getting expected result , can you please tell me where I am wrong xquery version "1.0-ml"; import module namespace config="http://www.makrlogic.com/morganStanley/delivery/ui/lib/searchConfig.xqy" at "/lib/searchConfig.xqy"; import module namespace search="http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy"; declare namespace fwp="http://morganstanley.com/firmwidePolicy"; declare namespace xhtml="http://www.w3.org/1999/xhtml"; declare variable $TAXONOMY_DOC :="/topicMaps/CCid.xml"; let $query:= cts:and-query((cts:directory-query("/policies/", "infinity"), cts:element-value-query(xs:QName("fwp:ccid"),"1N41"))) let $division:=(cts:search(//xhtml:html/xhtml:head/xhtml:meta, $query)) let $oldnode:=$division/fwp:divisions let $newnode:=fn:doc($TAXONOMY_DOC)/firmwidePolicy/CCid[@code="1H94"] return cts:search(//xhtml:html/xhtml:head/fwp:divisions, $query) Instead of above command if I am using below one , it giving result.. what's Wong in one more element for $uri in cts:uris((), (), $query) return fn:doc($uri)/xhtml:html/xhtml:head/fwp:divisions original XML is enclosed Marklogic : 5.0-1.2 ________________________________ NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
