
xdmp:eval-in( $xquery as xs:string, $ID as xs:unsignedLong*, [$vars as item()*], [$modules as xs:unsignedLong?], [$root as xs:string?] ) as item()*
[DEPRECATED: use xdmp:eval with the
database option instead] Returns the result of evaluating a string as
an XQuery module in a given database.
http://marklogic.com/xdmp/privileges/xdmp-eval
http://marklogic.com/xdmp/privileges/xdmp-eval-in
To use the modules or root options to specify
a modules database or root other than that configured for the
current App Server, you must have the following privilege:
http://marklogic.com/xdmp/privileges/xdmp-eval-modules-change
To use the modules or root options to specify
using the file system as the modules database or root path, you
must have the following privilege:
http://marklogic.com/xdmp/privileges/xdmp-eval-modules-change-file
xdmp:eval-in("1+1",2348790529)
=> 2
xquery version "0.9-ml"
declare namespace my='http://mycompany.com/test'
let $s :=
"xquery version '0.9-ml'
declare namespace my='http://mycompany.com/test'
define variable $my:x as xs:string external
concat('hello ', $my:x)"
return
(: evaluate the query string $s using the variables
supplied as the second parameter to xdmp:eval :)
xdmp:eval-in($s,
xdmp:database("Documents"),
(xs:QName("my:x"),
"world"))
=> hello world
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.