Abhishek, Can you try running the cts:search as "unfiltered" and see if it throws out something? If it does, then perhaps the results you are seeing are correct.
The documentation for cts:element-attribute-values says: The values do not need to match the query, but they must occur in fragments selected by the query. The fragments are not filtered to ensure they match the query, but instead selected in the same manner as "unfiltered" cts:search<http://pubs.marklogic.com:9876/5.0doc/docapp.xqy#display.xqy?fname=&category=%23unfiltered> operations. Gajanan From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Abhishek53 S Sent: Tuesday, August 30, 2011 7:52 AM To: General MarkLogic Developer Discussion Subject: [MarkLogic Dev General] Issue with element-attribute-value with query Hi Folks I am having some issue with getting element-attribute values with some additional query into the query option. The query below is returning 0 records -- which is fine cts:search(fn:doc(), cts:and-query(( cts:element-query(xs:QName("as-project-spec"), cts:and-query(( cts:element-attribute-value-query(xs:QName("as-project-spec"),xs:QName("div"),"00000"), cts:element-word-query(xs:QName("content"),"kolkata") )) ) )) ) Where as the query below is simply returning me some values from the value lexicons -- ideally it should not cts:element-attribute-values( xs:QName("as-project-spec"), xs:QName("div"), (), (), cts:and-query(( cts:element-query(xs:QName("as-project-spec"), cts:and-query(( cts:element-attribute-value-query(xs:QName("as-project-spec"),xs:QName("div"),"00050"), cts:element-word-query(xs:QName("content"),"kolkata") )) ) )) ) Though it is mentioned that this will return the values matching the fragments.Ideally as 0 fragments are matching the query ..element-attribute-values should not return any value. Let me know If I a wrong somewhere. Thanks & Regards Abhishek Srivastav Tata Consultancy Services Cell:- +91-9883389968 Mailto: abhishek5...@tcs.com<mailto:abhishek5...@tcs.com> Website: http://www.tcs.com<http://www.tcs.com/> ____________________________________________ Experience certainty. IT Services Business Solutions Outsourcing ____________________________________________ =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
_______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general