Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<project.build.target>1.8</project.build.target>

<exist.version>${project.version}</exist.version>
<templating.version>1.1.0</templating.version>
<templating.version>1.2.0</templating.version>
<node.version>v18.20.5</node.version>
<npm.version>10.8.2</npm.version>

Expand Down
36 changes: 22 additions & 14 deletions src/main/xar-resources/modules/view.xql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
xquery version "3.0";
xquery version "3.1";


import module namespace templates="http://exist-db.org/xquery/html-templating";
import module namespace lib="http://exist-db.org/xquery/html-templating/lib";
Expand All @@ -11,19 +12,26 @@ import module namespace review="http://exist-db.org/xquery/documentation/review"
import module namespace diag="http://exist-db.org/xquery/diagnostics" at "diagnostics.xql";
import module namespace app="http://exist-db.org/apps/docs/app" at "app.xql";

declare option exist:serialize "method=html5 media-type=text/html";

let $config := map {
declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization";

declare option output:method "html5";
declare option output:media-type "text/html";

declare function local:lookup ($functionName as xs:string, $arity as xs:integer) {
function-lookup(xs:QName($functionName), $arity)
};

declare variable $local:templating-configuration := map {
$templates:CONFIG_FILTER_ATTRIBUTES : true(),
$templates:CONFIG_USE_CLASS_SYNTAX : false(),
$templates:CONFIG_APP_ROOT : $config:app-root,
$templates:CONFIG_STOP_ON_ERROR : true()
}
let $lookup := function($functionName as xs:string, $arity as xs:integer) {
try {
function-lookup(xs:QName($functionName), $arity)
} catch * {
()
}
}
let $content := request:get-data()
return
templates:apply($content, $lookup, (), $config)
};

templates:apply(
request:get-data(),
local:lookup#2,
(),
$local:templating-configuration
)
Loading