It is a json:object (the map:map specialization)..
Try:
xdmp.xqueryEval(
'declare variable $obj external; map:get($obj, "name")',
{ obj: {name: 'name', title: 'title' }});
Cheers,
Geert
On 6/16/17, 9:27 PM, "[email protected] on behalf of
Florent Georges" <[email protected] on behalf of
[email protected]> wrote:
>Hi,
>
>I have an SJS script that calls a function from an XQuery library. It
>passes a JS object to the function. The function needs to access the
>value of one property of the object (in this case, a string).
>
>I can't find in the documentation how XQuery code can navigate through
>the properties of an in-memory JS object. Any idea?
>
>A self-contained example (my code require() an XQuery library and
>calls a function instead of using code evaluation, but the issue is
>the same):
>
> xdmp.eval(
> `declare variable $obj as external;
> $obj ! xs:string(name)`,
> { name: 'name', title: 'title' });
>
>I am using ML 9.
>
>Regards,
>
>--
>Florent Georges
>H2O Consulting
>http://h2o.consulting/
>_______________________________________________
>General mailing list
>[email protected]
>Manage your subscription at:
>http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general