xdmp:document-insert --error

Issues related to W3C XQuery.
Posts: 21
Joined: Sat Jan 07, 2017 12:54 am

xdmp:document-insert --error

Post 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>")
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: 927
Joined: Wed Nov 16, 2005 11:11 am

Re: xdmp:document-insert --error

Post by alex_jitianu »


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,
Post Reply