Hi Siva,
cts:not-query(cts:element-value-query(xs:QName("myelem"), "")) would exclude
empty myelem elements..
Kind regards,
Geert
From:
<[email protected]<mailto:[email protected]>>
on behalf of "Mani, Sivasubramani (ELS)"
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Date: Friday, September 1, 2017 at 1:32 PM
To: "[email protected]<mailto:[email protected]>"
<[email protected]<mailto:[email protected]>>
Cc: ConSyn-Infosys-Support
<[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] Regarding cts:element-value-query
Hi Team,
I use cts:element –query() & cts:element-value-query() to filter the documents
based on their elements and element values. I need to filter the documents
based on elements with values only but above query’s consider the empty
elements also.
<book>
<pii>S56789</pii>
<cp>ES</cp>
</book>
<book>
<pii></pii>
<cp></cp>
</book>
<book>
<pii>S56789</pii>
<cp>ES</cp>
</book>
This is my query cts:and-query(( cts:element-query(xs:Qname(“pii”),”*”),
cts:element-query(xs:Qname(“cp”),”*”) )) or cts:and-query((
cts:element-value-query(xs:Qname(“pii”),”*”),
cts:element-value-query(xs:Qname(“cp”),”*”) )) both the query includes empty
element in the result. I need to filter out the empty element from the result.
Kindly do the needful.
Thanks & Regards,
Siva
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general