Hi Adam,

It is telling you that the XML for your cts:query is not correct.

Note that you were not building a cts:element-query, but were building an XML 
representation of a cts:element-query.

You might try constructing this query as a cts:query like this:

xquery version "1.0-ml";

let $engQuery := "dog"
let $deQuery := "cat"
return
cts:element-query(
       fn:QName("http://www.tei-c.org/ns/1.0";, "div"),
       cts:or-query(($engQuery, $deQuery))
)

and if you need the XML representation of a cts:query then wrap the cts:query 
in an element and take the contents of that element:

xquery version "1.0-ml";

let $engQuery := "dog"
let $deQuery := "cat"
return
<foo>{cts:element-query(
       fn:QName("http://www.tei-c.org/ns/1.0";, "div"),
       cts:or-query(($engQuery, $deQuery))
)}</foo>/*

-Danny

From: [email protected] 
[mailto:[email protected]] On Behalf Of Adam Patterson
Sent: Tuesday, April 13, 2010 2:03 PM
To: [email protected]
Subject: [MarkLogic Dev General] Noobie cts:element-query question

I apologize in advance for this question as I'm sure it's very straightforward, 
but it does have me stumped. I am building a cts:element-query as follows:

<cts:element-query>
{
                fn:QName("http://www.tei-c.org/ns/1.0";, "div"),
                <cts:or-query>{$engQuery, $deQuery}</cts:or-query>
}
</cts:element-query>

MarkLogic is telling me that I have the following error:

"XDMP-QUERYTEXT: cts:query(<cts:and-query 
xmlns:cts="http://marklogic.com/cts";><cts:element-query 
xmlns:tei="http://www.tei-c.org/ns/1.0";>tei:d...</cts:and-query>) -- Query 
element /cts:and-query/cts:element-query contains misplaced text"

Please let me know (1) What this error means, and (2) What I'm doing wrong to 
cause it.

Thank you,

Adam
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to