[MarkLogic Dev General] Regarding cts:element-value-query

Mani, Sivasubramani (ELS) s.mani at elsevier.com
Fri Sep 1 04:32:56 PDT 2017


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20170901/0a21c8fa/attachment.html 


More information about the General mailing list