Hi Gerrit,

Right, the »parameter-document« serialization parameter is currently
not supported by RESTXQ, as this might cause too many conflicts at
runtime. You can try »use-character-maps« instead (with and without
RESTXQ, with a slightly non-standard syntax):

declare
   %rest:path("/test")
   %output:use-character-maps(">=>,1=3")
function _:html() {
  <xml> 1 > 2 </xml>
};

declare option output:use-character-maps '>=>,1=3';
<script> 1 > 2 </script>

serialize(<xml> 1 > 2 </xml>,
  map { 'use-character-maps': '>=>,1=3' }
)

…and the standard way, for fn:serialize, as a reminder:

serialize(<xml> 1 > 2 </xml>,
  map { 'use-character-maps': map { '>': '>', '1': '3' } }
)

Keys and values are separated by the equal sign; pairs are separated
by commas. Separators that are to be defined as keys or values can be
encoded as entities (see the updated article on serialization
parameters [1]).

Hope this helps,
Christian

[1] https://docs.basex.org/wiki/Serialization#Parameters

Reply via email to