xdmp:document-insert --error

Issues related to W3C XQuery.
Posts: 21

xdmp:document-insert --error

Mon Jan 30, 2017 11:14 pm

Consider this simple script that I try to run in oxygen. Its connected to Marklogic server.

let $a1:=xdmp:unquote("<a><b>bbb</b></a>")
In oxygen editor it gives error- XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected QName_

Same script runs fine in marklogic query console.
Posts: 653

Re: xdmp:document-insert --error

Tue Jan 31, 2017 4:14 pm


The different behavior might be explained if Oxygen and Marklogic's query console use AppServers that have different default xquery version. For an Xquery 1.0 the query should be:

Code: Select all

let $a1 := xdmp:unquote("<a><b>bbb</b></a>")
return xdmp:document-insert("/vk/test/example.xml",$a1)

If needed, you can force the query version of the query:

Code: Select all

xquery version "0.9-ml";
let $a1 := xdmp:unquote("<a><b>bbb</b></a>")

Best regards,

Return to “XQuery”

Who is online

Users browsing this forum: No registered users and 1 guest