Commit 9281531c authored by Guillaume Porte's avatar Guillaume Porte 😶
Browse files

%output:method("html") + %output:html-version("5.0") + %output:encoding("UTF-8")

parent 5c11c619
Loading
Loading
Loading
Loading
+26 −7
Changes for max.xq: 26 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ import module namespace request = "http://exquery.org/ns/request";
declare
%rest:GET
%output:method("html")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path( "/max")
function max:home(){
   <html>
@@ -37,6 +39,8 @@ declare option db:chop 'false';
declare
%rest:GET
%output:method("html")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path( "/{$project}")
function max:projectHome($project){
   web:redirect(request:uri() || '/accueil')
@@ -51,7 +55,8 @@ function max:projectHome($project){
declare
%rest:GET
%output:method("html")
%output:indent("no")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path( "/{$project}/{$page=[a-zA-Z0-9_]+}")
function max:page($project, $page){
  try{
@@ -95,7 +100,8 @@ function max:page($project, $page){
declare
%rest:GET
%output:method("html")
%output:indent("no")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path("/{$project}/sommaire/{$doc=[^plugins].*\.xml|.*\.svg}")
function max:documentTOC($project,$doc){
    max.html:render($project, "sommaire", max.toc:getDocumentTOC($project, $doc))
@@ -105,7 +111,8 @@ function max:documentTOC($project,$doc){
declare
%rest:GET
%output:method("html")
%output:indent("no")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path("/{$project}/{$routeDoc=[^plugins].*\.xml}/{$id}")
function max:fragmentToHTMLPage($project, $routeDoc, $id){

@@ -144,7 +151,8 @@ Highlights $search in a subfragment ($targetId) in a parent fragment ($id)
declare
%rest:GET
%output:method("html")
%output:indent("no")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path("/{$project}/{$routeDoc=[^plugins].*\.xml}/{$id}/target/{$targetId}/{$search}")
function max:HighlightedSearchToHTMLPage($project, $routeDoc, $id, $targetId, $search){
   
@@ -163,7 +171,8 @@ Auto focus/scroll fragment ($idFocus) in a full document
declare
%rest:GET
%output:method("html")
%output:indent("no")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path("/{$project}/{$routeDoc=[^plugins].*\.xml}/focus/{$idFocus}")
function max:focusOnIdToHTML($project, $routeDoc, $idFocus){
    copy $c := max:getFullDocument($project, $routeDoc)
@@ -179,7 +188,8 @@ Auto focus/scroll fragment ($idFocus) in a main fragment ($idPart)
declare
%rest:GET
%output:method("html")
%output:indent("no")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path("/{$project}/{$routeDoc=[^plugins].*\.xml}/focus/{$idPart}/{$idFocus}")
function max:focusOnPartAndIdToHTMLPage($project, $routeDoc,$idPart, $idFocus){
  copy $c := max:fragmentToHTMLPage($project, $routeDoc, $idPart)
@@ -193,6 +203,8 @@ function max:focusOnPartAndIdToHTMLPage($project, $routeDoc,$idPart, $idFocus){
declare
%rest:GET
%output:method("html")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path("/{$project}/checkplugins")
function max:checkPlugin($project){
    let $plugins := max.config:getPluginNameList($project)
@@ -223,6 +235,8 @@ function max:checkPlugin($project){
declare
%rest:GET
%output:method("html")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path("/{$project}/fragment/{$id}")
function max:getXMLByID($project, $id){
  max.api:getXMLByID(max.config:getProjectDBPath($project), $id)
@@ -232,6 +246,8 @@ function max:getXMLByID($project, $id){
declare
%rest:GET
%output:method("html")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:query-param("xsl", "{$xsl}")
%rest:query-param("xslparams","{$xslparams}")
%rest:query-param("wrap", "{$wrap}")
@@ -263,7 +279,8 @@ function max:getHTMLByID($project, $id, $xsl, $xslparams as xs:string *, $wrap a
declare
%rest:GET
%output:method("html")
%output:indent("no")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path("/{$project}/doc/{$doc=.*\.xml|.*\.svg}")
function max:getFullDocument($project, $doc){
  
@@ -288,6 +305,8 @@ declare function max:transformEditionFragment($project, $xml, $route){
declare
  %rest:error("err:max")
  %output:method("html")
  %output:html-version("5.0")
  %output:encoding("UTF-8")
  %rest:error-param("description", "{$desc}")
  function max:max-error($desc)
{