I apologize in advance, because I know the answer will be simple (but I couldn't find an example and have tried all sorts of options). I am trying to run xquery:eval passing in a string to evaluate and a map of bindings. Everything I try I get an 'Undefined variable' error. Here is a simple example I tried in the BaseX Gui. let $a := 3let $string := "$a + 1"returnxquery:eval($string, map{"a" : $a} This is just one attempt, but there were many others. Again, I know this is going to be a simple mistake I'm making, so apologies to the community in advance.
Thanks, Buddy
Hi Buddy,
You’ll need to add a variable declaration in the query string; see [1] for examples.
Hope this helps, Christian
[1] http://docs.basex.org/wiki/XQuery_Module#xquery:eval
On Sat, Jun 17, 2017 at 7:01 PM, Buddy Kresge buddyonweb-software@yahoo.com wrote:
I apologize in advance, because I know the answer will be simple (but I couldn't find an example and have tried all sorts of options).
I am trying to run xquery:eval passing in a string to evaluate and a map of bindings. Everything I try I get an 'Undefined variable' error.
Here is a simple example I tried in the BaseX Gui.
let $a := 3 let $string := "$a + 1" return xquery:eval($string, map{"a" : $a}
This is just one attempt, but there were many others.
Again, I know this is going to be a simple mistake I'm making, so apologies to the community in advance.
Thanks,
Buddy
basex-talk@mailman.uni-konstanz.de