Re: [MarkLogic Dev General] Accessing properties of in-memory JS object in XQuery

2017-06-18 Thread Florent Georges
> > > -- > *From:* general-boun...@developer.marklogic.com [ > general-boun...@developer.marklogic.com] on behalf of Florent Georges [ > li...@fgeorges.org] > *Sent:* Friday, June 16, 2017 2:40 PM > *To:* MarkLogic Developer Discussion > *Subject:* Re

Re: [MarkLogic Dev General] Accessing properties of in-memory JS object in XQuery

2017-06-17 Thread Erik Hennum
From: general-boun...@developer.marklogic.com [general-boun...@developer.marklogic.com] on behalf of Florent Georges [li...@fgeorges.org] Sent: Friday, June 16, 2017 2:40 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Accessing properties of in-memory JS

Re: [MarkLogic Dev General] Accessing properties of in-memory JS object in XQuery

2017-06-16 Thread Florent Georges
Hi Geert, I was mot expecting Europe to still answer at this time, but that was counting without you ;-) Thank you, it works indeed as a charm. But it seems I oversimplified my example. The problem actually comes from the fact that the value is an array of objecst, and just iterating over it

Re: [MarkLogic Dev General] Accessing properties of in-memory JS object in XQuery

2017-06-16 Thread Geert Josten
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, "general-boun...@developer.marklogic.com on behalf of Florent

[MarkLogic Dev General] Accessing properties of in-memory JS object in XQuery

2017-06-16 Thread Florent Georges
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