Bug #4647
closedomit-xml-declaration for adaptive serialization
100%
Description
For adaptive serialization, setting the omit-xml-declaration
parameter has no affect. XML declarations are never output when serializing nodes, so in effect the default is "true", and setting the parameter to "false" has no affect (i.e. this does not force XML declarations to be included).
For instance, try amending the XSLT30 test result-document-0304. The test was relatively recently amended to explicitly set omit-xml-declaration="true"
on the xsl:result-document
instruction. Removing the parameter, or changing it to set omit-xml-declaration="false"
has no affect on the result.
Note that the expected default depends on where the serialization comes from.
The XSLT 3.0 specification says that the default for omit-xml-declaration
is false (https://www.w3.org/TR/xslt-30/#element-output):
"The value of the omit-xml-declaration attribute provides the value of the omit-xml-declaration parameter to the serialization method. The default value is no."
Meanwhile the XQuery 3.1 specification, under "D. Implementation-Defined items" (https://www.w3.org/TR/xquery-31/#id-impl-defined-items), says that the default is implementation-defined:
"The following items in this specification are implementation-defined: [...]
- The default values for the byte-order-mark, encoding, html-version, item-separator, media-type, normalization-form, omit-xml-declaration, standalone, and version parameters, if the Serialization Feature is supported."
(And the Saxon documentation does not explicitly state what these defaults are at http://www.saxonica.com/documentation/index.html#!conformance/xquery31)
While the specification for the fn:serialize
function, says the default for omit-xml-declaration is different again:
(https://www.w3.org/TR/xpath-functions-31/#func-serialize):
"If the second argument is omitted, or is supplied in the form of an output:serialization-parameters
element, then the values of any serialization parameters that are not explicitly specified is ·implementation-defined·, and may depend on the context."
"If the second argument is supplied as a map [...] The required type of each parameter, and its default value, are defined by the following table."
And the table says that here the default for omit-xml-declaration
is "yes" i.e. true()."
Please register to edit this issue