This function serializes the supplied input sequence $arg
as described in , returning the serialized representation of the sequence as a string.
This function is deterministic, context-independent, and focus-independent.
The value of the first argument $arg
acts as the input sequence to the serialization process, which starts with sequence normalization.
The second argument $params
, if present, provides
serialization parameters. These may be supplied in either of two forms:
As an
output:serialization-parameters
element, having the format described in . In this case the type of the supplied argument must match the required typeelement[output:serialization-parameters]
.As a map. In this case the type of the supplied argument must match the required type
map[*]
The single-argument version of this function has the same effect as the two-argument version called with $params
set to an empty sequence. This
in turn is the same as the effect of passing an output:serialization-parameters
element with no child elements.
The final stage of serialization, that is, encoding, is skipped. If the serializer does not allow this phase to be skipped, then the sequence of octets returned by the serializer is decoded into a string by reversing the character encoding performed in the final stage.
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, then the option parameter conventions apply. In this case:
Each entry in the map defines one serialization parameter.
The key of the entry is an
xs:string
value in the cases of parameter names defined in these specifications, or anxs:QName
[with non-absent namespace] in the case of implementation-defined serialization parameters.The required type of each parameter, and its default value, are defined by the following table. The default value is used when the map contains no entry for the parameter in question, and also when an entry is present, with the empty sequence as its value. The table also indicates how the value of the map entry is to be interpreted in cases where further explanation is needed.
allow-duplicate-names
| xs:boolean?
| true[] means "yes", false[] means "no"
| no
|
byte-order-mark
| xs:boolean?
| true[] means "yes", false[] means "no"
| no
|
cdata-section-elements
| xs:QName*
| []
| |
doctype-public
| xs:string?
| Zero-length string and [] both represent "absent"
| absent |
doctype-system
| xs:string?
| Zero-length string and [] both represent "absent"
| absent |
encoding
| xs:string?
| utf-8
| |
escape-uri-attributes
| xs:boolean?
| true[] means "yes", false[] means "no"
| yes
|
html-version
| xs:decimal?
| 5
| |
include-content-type
| xs:boolean?
| true[] means "yes", false[] means "no"
| yes
|
indent
| xs:boolean?
| true[] means "yes", false[] means "no"
| no
|
item-separator
| xs:string?
| absent | |
json-node-output-method
| union[xs:string, xs:QName]?
| See Notes 1, 2 | xml
|
media-type
| xs:string?
| [a media type suitable for the chosen method ]
| |
method
| union[xs:string, xs:QName]?
| See Notes 1, 2 | xml
|
normalization-form
| xs:string?
| none
| |
omit-xml-declaration
| xs:boolean?
| true[] means "yes", false[] means "no"
| yes
|
standalone
| xs:boolean?
| true[] means "yes", false[] means "no", [] means "omit"
| omit
|
suppress-indentation
| xs:QName*
| []
| |
undeclare-prefixes
| xs:boolean?
| true[] means "yes", false[] means "no"
| no
|
use-character-maps
| map[xs:string, xs:string]?
| See Note 3 | map{}
|
version
| xs:string?
| 1.0
|
Notes to the table:
The notation
union[A, B]
is used to represent a union type whose member types areA
andB
.If an
xs:QName
is supplied for themethod
orjson-node-output-method
options, then it must have a non-absent namespace URI. This means that system-defined serialization methods such asxml
andjson
are defined as strings, not asxs:QName
values.For the
use-character-maps
option, the value is a map, whose keys are the characters to be mapped [asxs:string
instances], and whose corresponding values are the strings to be substituted for these characters. The option parameter conventions apply recursively to this nested map.