Maybe I'm missing something, but the node your query returns
let $query:=
cts:and-query((cts:directory-query("/policies/", "infinity"),
cts:element-value-query(xs:QName("fwp:ccid"),"1N41")))and the node your xpath returns //xhtml:html/xhtml:head/fwp:divisions look like they are in separate nodes. There is no ancestor or self relationship. This doesn't concern your cts:uris query because it first returns the document, then from the document gets the result of the xpath. Matthew Treskon From: [email protected] [mailto:[email protected]] On Behalf Of Singh, Gurbeer Sent: Wednesday, October 03, 2012 4:56 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] A question on cts:search No, I tried in both way , //xhtml:html/xhtml:head/xhtml:meta/fwp:divisions --> no result /xhtml:html/xhtml:head/fwp:divisions --> no result But for $uri in cts:uris((), (), $query) return fn:doc($uri)/xhtml:html/xhtml:head/fwp:divisions --> expected result From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Danny Sokolsky Sent: Wednesday, October 03, 2012 4:54 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] A question on cts:search 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]> [mailto:[email protected]] On Behalf Of Singh, Gurbeer Sent: Wednesday, October 03, 2012 1:48 PM To: [email protected]<mailto:[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. ________________________________ 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. This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
