Re: [basex-talk] Templating

2014-10-18 Thread Andy Bunce
The evaluated query has its own query context. The only variables available inside are those passed in the bindings. If you want access to a map variable you must pass it in e.g. declare %restxq:path('/test2') %restxq:GETfunction test:test2(){ let $map := map{ "map":map{ "greeting" :

Re: [basex-talk] Templating

2014-10-17 Thread Emmanuel Chateau
Thanks a lot ! it solved it. I had tried to change the view file to xquery, but i dont’t know why, i didn’t test with a variable declaration at first. It works with individual variable declaration (`view1.xq`), but I can’t get back the map itself (in `view2.xq`). Is it a consistent behavior ? Am

Re: [basex-talk] Templating

2014-10-17 Thread Andy Bunce
To be more clear. The render arguments that referenced xml files now reference xquery files. e.g. return render("main.xq",map{}) On 17 October 2014 21:37, Andy Bunce wrote: > Hi Emmanuel, > > At some point BaseX was changed so that variables must be declared. > Now you must declare the variables

Re: [basex-talk] Templating

2014-10-17 Thread Andy Bunce
Hi Emmanuel, At some point BaseX was changed so that variables must be declared. Now you must declare the variables used in the template. I do this see [1] This loses the advantages of the templates being XML but otherwise works fine. /Andy [1] https://github.com/Quodatum/app-doc/tree/master/src

[basex-talk] Templating

2014-10-17 Thread Emmanuel Chateau
Hi, I’ve been trying to use the templating proposed by Andy Bunce here http://cubeb.blogspot.fr/2012/11/xquery-templating-engines-and-txq.html https://mailman.uni-konstanz.de/pipermail/basex-talk/2012-November/004209.html I’ve tried with txq module in different ways. But, I can’t figure out why