diff --git a/modules/lib/api.json b/modules/lib/api.json
index 4909cc51..b1d21997 100644
--- a/modules/lib/api.json
+++ b/modules/lib/api.json
@@ -1299,6 +1299,16 @@
"type": "string"
}
},
+ {
+ "name": "serialize",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "enum": ["xml", "html5"],
+ "default": "html5"
+ },
+ "description": "should HTML content be rendered as HTML5 or XML?"
+ },
{
"name": "If-Modified-Since",
"in": "header",
@@ -3421,7 +3431,26 @@
}
}
}
- }
+ },
+ "/sitemap.xml": {
+ "get": {
+ "description": "Return generated sitemap",
+ "operationId": "sitemap:sitemap",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/xml": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
},
"security": [
{
diff --git a/modules/lib/api/document.xql b/modules/lib/api/document.xql
index 91b92f9a..8d211d36 100644
--- a/modules/lib/api/document.xql
+++ b/modules/lib/api/document.xql
@@ -522,12 +522,14 @@ declare function dapi:get-fragment($request as map(*), $docs as node()*, $path a
"content": serialize($transformed?content,
no
- html5
+ {$request?parameters?serialize}
+ yes
),
"footnotes": serialize($transformed?footnotes,
no
- html5
+ {$request?parameters?serialize}
+ yes
),
"userParams": $userParams,