Loading max.xq +0 −1 Original line number Diff line number Diff line Loading @@ -396,4 +396,3 @@ declare rxq/html.xqm +2 −1 Original line number Diff line number Diff line Loading @@ -382,7 +382,8 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){ declare function max.html:getHTMLFragment($project, $fragmentName as xs:string) as element(div){ let $fragmentPath := max.util:maxHome() ||"/editions/"||$project|| "/fragments/"||$fragmentName|| ".frag.html" return <div id='content'>{doc($fragmentPath)}</div> let $content := fetch:xml($fragmentPath, map { 'parser': 'html','htmlparser': map { 'html': false(), 'nodefaults': true() }}) return <div id='content'>{$content}</div> }; (:gets a project static HTML fragment (wrapped in an html div):) Loading rxq/max_api.xqm +16 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ knowledge of the CeCILL-B license and that you accept its terms. :) module namespace max.api = 'pddn/max/max_api'; import module namespace max.util = 'pddn/max/util' at 'util.xqm'; (:Returns XML fragment identified by $id:) declare Loading @@ -99,6 +99,20 @@ function max.api:getXMLByID($db, $id, $q){ } }; (:Returns XML fragment in a specified document :) declare %rest:GET %output:method("html") %rest:path("/sf/{$routeDoc=.*\.xml|.*\.svg}/{$id}") function max.api:getXMLByIDinDOC($routeDoc, $id){ try{ doc($routeDoc)//*[@xml:id=$id or @id=$id][1] } catch *{ <div class='error'>{'Error [' || $err:code || '/' || $err:module || '/' || $err:line-number ||']: ' || $err:description}</div> } }; declare function max.api:getXMLByID($db, $id){ max.api:getXMLByID($db, $id, ()) }; Loading Loading @@ -133,3 +147,4 @@ function max.api:getXMLByIDInDoc($doc, $id){ rxq/util.xqm +2 −2 Original line number Diff line number Diff line Loading @@ -79,7 +79,6 @@ knowledge of the CeCILL-B license and that you accept its terms. module namespace max.util = 'pddn/max/util'; declare namespace xsl = "http://www.w3.org/1999/XSL/Transform"; (: : Returns binary-file :) Loading Loading @@ -259,3 +258,4 @@ declare function max.util:listContextFunction(){ </ul> }; Loading
rxq/html.xqm +2 −1 Original line number Diff line number Diff line Loading @@ -382,7 +382,8 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){ declare function max.html:getHTMLFragment($project, $fragmentName as xs:string) as element(div){ let $fragmentPath := max.util:maxHome() ||"/editions/"||$project|| "/fragments/"||$fragmentName|| ".frag.html" return <div id='content'>{doc($fragmentPath)}</div> let $content := fetch:xml($fragmentPath, map { 'parser': 'html','htmlparser': map { 'html': false(), 'nodefaults': true() }}) return <div id='content'>{$content}</div> }; (:gets a project static HTML fragment (wrapped in an html div):) Loading
rxq/max_api.xqm +16 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ knowledge of the CeCILL-B license and that you accept its terms. :) module namespace max.api = 'pddn/max/max_api'; import module namespace max.util = 'pddn/max/util' at 'util.xqm'; (:Returns XML fragment identified by $id:) declare Loading @@ -99,6 +99,20 @@ function max.api:getXMLByID($db, $id, $q){ } }; (:Returns XML fragment in a specified document :) declare %rest:GET %output:method("html") %rest:path("/sf/{$routeDoc=.*\.xml|.*\.svg}/{$id}") function max.api:getXMLByIDinDOC($routeDoc, $id){ try{ doc($routeDoc)//*[@xml:id=$id or @id=$id][1] } catch *{ <div class='error'>{'Error [' || $err:code || '/' || $err:module || '/' || $err:line-number ||']: ' || $err:description}</div> } }; declare function max.api:getXMLByID($db, $id){ max.api:getXMLByID($db, $id, ()) }; Loading Loading @@ -133,3 +147,4 @@ function max.api:getXMLByIDInDoc($doc, $id){
rxq/util.xqm +2 −2 Original line number Diff line number Diff line Loading @@ -79,7 +79,6 @@ knowledge of the CeCILL-B license and that you accept its terms. module namespace max.util = 'pddn/max/util'; declare namespace xsl = "http://www.w3.org/1999/XSL/Transform"; (: : Returns binary-file :) Loading Loading @@ -259,3 +258,4 @@ declare function max.util:listContextFunction(){ </ul> };