1

Using BaseX 8.6 the following use of the serialize function with a map as the second argument works fine:

serialize(<root><foo><bar>test</bar></foo></root>, map { 'indent' : 'yes'})

and outputs the indented code

<root>
  <foo>
    <bar>test</bar>
  </foo>
</root>

However, when I try to run the same code with Saxon 9.7 or AltovaXML Spy they don't compile the query and complain about map { 'indent' : 'yes'} not being a boolean value but a string. https://www.w3.org/TR/xpath-functions-31/#func-serialize defines

indent  xs:boolean?     true() means "yes", false() means "no"

so I am not quite sure whether that allows only a boolean and is meant to explain its meaning in relation to the serialization values of yes/no or whether it also means using yes or no is allowed.

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110

1 Answers1

2

In BaseX, the map argument was added before it was integrated in the XQFO 3.1 specification. Back then, the most obvious choice was to use the syntax for output declarations in the query prolog (in which only strings can be used for values of serialization parameters). – The new official syntax will be made available in a future version of BaseX.

Christian Grün
  • 6,012
  • 18
  • 34