Search code examples
marklogic

XDMP-QUERYNOVALS with map XML containing cts:query XML


I am trying to construct a map from XML, which contains `cts:element-range-query for one of the values. When I run it in cq it throws XDMP-QUERYNOVALS. The same XML works in ML5. Is there any settings which needs to be changed for this to work in ML7?

let $request-body := <wrapper xmlns="xdmp:http">
  <map:map xmlns:map="http://marklogic.com/xdmp/map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <map:entry key="GLOBAL">
      <map:value><cts:and-query xmlns:cts="http://marklogic.com/cts">
                  <cts:or-query>
                    <cts:element-range-query operator="=">
                      <cts:element>abcd</cts:element>
                    </cts:element-range-query>
                  </cts:or-query>
        </cts:and-query></map:value>
  </map:entry>
</map:map></wrapper>    
return map:map($request-body/node())

Error Message:

[1.0-ml] XDMP-QUERYNOVALS: map:map(
<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:map="http://marklogic.com/xdmp/map" xmlns="xdmp:http">
<map:entry key="GLOBAL"><map:value><cts:and-query xmlns:cts="htt...</map:map>)
 -- /*:wrapper/map:map/map:entry/map:value/cts:and-query/cts:or-query/cts:element-range-query

Thanks, Selva


Solution

  • Look closely at the cts:element-range-query XML. It has no cts:value element. So the cts:query XML is invalid. That could happen if you built the cts:query XML automatically, and never validated it.

    MarkLogic 7 may be stricter about this than MarkLogic 5 was, but with either version the XML does not represent a valid query.