Loading src/main/core/utils.xqm +11 −7 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ module namespace utils = "https://certic.unicaen.fr/max/utils"; import module namespace conf = 'https://certic.unicaen.fr/max/conf'; import module namespace database = 'https://certic.unicaen.fr/max/database'; import module namespace errors = 'https://certic.unicaen.fr/max/errors'; (:~ locales dir:) declare variable $utils:locales_dir := "locales/"; Loading @@ -22,6 +23,7 @@ declare function utils:doc-to-html($collection as xs:string?, $doc as xs:string, (: - exécute la fonction doc-to-html du bundle de vocabulaire actif :) try{ let $ns := conf:get-vocabulary-namespace() let $declaration := "declare variable $doc external; declare variable $lang external;" let $import := "import module namespace vocabulary = '"|| $ns ||"';" Loading @@ -29,6 +31,8 @@ declare function utils:doc-to-html($collection as xs:string?, $doc as xs:string, let $doc := database:get-document($collection || '/' || $doc || '.xml') let $query := 'vocabulary:doc-to-html($doc, $lang)' return xquery:eval($import || $declaration || $query, map {'doc' : $doc, 'lang': $lang}) } catch repo:not-found {errors:error($err:code, $err:description, $err:line-number, $lang)} }; Loading Loading
src/main/core/utils.xqm +11 −7 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ module namespace utils = "https://certic.unicaen.fr/max/utils"; import module namespace conf = 'https://certic.unicaen.fr/max/conf'; import module namespace database = 'https://certic.unicaen.fr/max/database'; import module namespace errors = 'https://certic.unicaen.fr/max/errors'; (:~ locales dir:) declare variable $utils:locales_dir := "locales/"; Loading @@ -22,6 +23,7 @@ declare function utils:doc-to-html($collection as xs:string?, $doc as xs:string, (: - exécute la fonction doc-to-html du bundle de vocabulaire actif :) try{ let $ns := conf:get-vocabulary-namespace() let $declaration := "declare variable $doc external; declare variable $lang external;" let $import := "import module namespace vocabulary = '"|| $ns ||"';" Loading @@ -29,6 +31,8 @@ declare function utils:doc-to-html($collection as xs:string?, $doc as xs:string, let $doc := database:get-document($collection || '/' || $doc || '.xml') let $query := 'vocabulary:doc-to-html($doc, $lang)' return xquery:eval($import || $declaration || $query, map {'doc' : $doc, 'lang': $lang}) } catch repo:not-found {errors:error($err:code, $err:description, $err:line-number, $lang)} }; Loading