Closed dizzzz closed 10 years ago
I have my own 'each' that works:
declare function app:each($node as node(), $model as map(), $from as xs:string, $to as xs:string) { for $item in $model($from) return element { node-name($node) } { $node/@, templates:process($node/node(), map:new(($model, map:entry($to, $item)))) } };
I think that the %temlpates:wrap is the problem in this case.
I pushed your change in ccba1369009a97ad7b5a46884821d8a1d85b98aa
The templates:each is working properly now. The debug flag works as well!
The templates.xql should have documentation within it to tell people how to set things like the debug flag.
To turn on the debug, in view.xql in the modules collection of the app, change:
let $config := map { $templates:CONFIG_APP_ROOT := $config:app-root, $templates:CONFIG_STOP_ON_ERROR := true() }
to
let $config := map { $templates:CONFIG_APP_ROOT := $config:app-root, $templates:CONFIG_DEBUG := true(), $templates:CONFIG_STOP_ON_ERROR := true() }
Thank you Wolfgang.
https://github.com/eXist-db/exist/issues/203