Page 1 of 1

xdmp:document-insert --error

Posted: Mon Jan 30, 2017 11:14 pm
by vkdev
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>")
xdmp:document-insert("/vk/test/example.xml",$a1
)
In oxygen editor it gives error- XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected QName_

Same script runs fine in marklogic query console.

Re: xdmp:document-insert --error

Posted: Tue Jan 31, 2017 4:14 pm
by alex_jitianu
Hi,

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>")
xdmp:document-insert("/vk/test/example.xml",$a1)


Best regards,
Alex