xdmp:document-insert --error

Issues related to W3C XQuery.
vkdev
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>")
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.
alex_jitianu
Posts: 600

Re: xdmp:document-insert --error

Tue Jan 31, 2017 4:14 pm

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

Return to “XQuery”

Who is online

Users browsing this forum: No registered users and 0 guests