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 I couldn’t reproduce it.
Here is the simpler exemple I’ve tried :
In the webapp folder an xml file, named `view1.xml` wich contains :
```xml
<div>{map:get($map, 'greeting')}</div>
```
In webapp a restxq file with :
```xquery
module namespace test = 'test.test';
import module namespace xquery = "http://basex.org/modules/xquery";
declare function test:render($template as xs:string, $map as map(*)){
xquery:invoke($template,$map)
};
declare %restxq:path('/test')
%restxq:GET
function test:test(){
let $map := map{ "greeting" : "hello",
"who": "world"}
return test:render('view1.xml', $map )
};
```
Arrêté à /Users/emmanuelchateau/Documents/basex/webapp/view1.xq, 1/15:
[XPST0008] Undefined variable $map.
I’m running BaseX version 7.9
Is there still anybody with this kind of templating running ?
Thanks a lot for your help.
Emmanuel