Table of contents
Appendices
|
3 Serialization Parameters
Serialization Parameters
There are a number of parameters that influence how serialization
is performed. Host languages MAY allow users to specify any or all of
these parameters, but they are not REQUIRED to be able to do so.
The following serialization parameters are defined:
Ed. Note:
Here and throughout the document, the distinction between "should"
and "must" will be revisited. When serialization was described in the XSLT
specification, use of "should" helped to clarify that the serialization process
was optional. Now that it's described here in a standalone specification,
many of those clauses should use "must".
add1Serialization parameters
Serialization parameter name
Permitted values for parameter
byte-order-mark |
One of the enumerated values
yes or no. This parameter indicates
whether the serialized sequence of octects is to be preceded by
a Byte Order Mark. (See Section 5.1 of
[UNICODE-ENCODING].) The actual byte order used is
implementation-dependent.
If the concept of a Byte Order Mark is
not meaningful in connection with the value of the
encoding parameter, the byte-order-mark
parameter is ignored. |
cdata-section-elements |
A list of expanded-QNames, possibly empty. |
doctype-public |
A string of Unicode characters. This parameter is optional. |
doctype-system |
A string of Unicode characters. This parameter is optional. |
encoding |
A string of Unicode characters in the range #x21 to #x7E (that is,
printable ASCII characters); the value SHOULD be a charset
registered with the Internet Assigned Numbers Authority
[IANA], [RFC2278] or begin with the
characters x- or X-. |
escape-uri-attributes |
One of the enumerated values yes or no. |
include-content-type |
One of the enumerated values yes or no. |
indent |
One of the enumerated values yes or no. |
media-type |
A string of Unicode characters specifying the media type (MIME
content type)
[RFC2376]
[RFC2046];
the charset parameter of
the media type MUST NOT be specified explicitly in the value of
the media-type parameter.
If the destination of the serialized output
is annotated with a media type, this parameter MAY be used to
provide such an annotation. For example, it MAY be used to set
the media type in an HTTP header. |
method |
An expanded-QName with a null namespace URI, and the local part of
the name equal to one of xml, xhtml,
html or text, or having a non-null
namespace URI. If the namespace URI is non-null, the parameter
specifies an
implementation-defined
output method. |
normalization-form |
One of the enumerated values NFC, NFD,
NFKC, NFKD, fully-normalized,
none or an
implementation-defined value. |
omit-xml-declaration |
One of the enumerated values yes or no. |
standalone |
One of the enumerated values yes, no or
none. |
undeclare-namespaces |
One of the enumerated values yes or no. |
use-character-maps |
A list of pairs, possibly empty, with each pair consisting of
a single Unicode character and a string of Unicode characters. |
version |
A string of Unicode characters. |
-
encoding specifies the preferred character
encoding that the
processor
serializer
SHOULD use
for encoding sequences of
characters as sequences of bytes; the value of the parameter SHOULD be
treated case-insensitively; the value MUST contain only characters in
the range #x21 to #x7E (i.e. printable ASCII characters); the value
SHOULD either be a charset registered with the Internet
Assigned Numbers Authority [IANA],
[RFC2278] or start with X-
If this parameter is not specified,
and the output method does not specify
any additional requirements, the encoding used is
implementation-defined.
-
cdata-section-elements specifies a list of the
names of elements whose text node children
are to be output using
CDATA sections
If this parameter is not specified, no elements will be treated specially.
-
doctype-system specifies the system identifier
to be used in the document type declaration
delCIf this parameter is not specified,
no system identifier will
a system
identifer MUST NOT be generated.
For XML and XHTML output methods,
no public identifier will
a public identifer
MUST NOT be generated either,
regardless of the setting of doctype-public.
-
doctype-public specifies the public identifier
to be used in the document type declaration
delCIf this parameter is not specified,
a public
identifier MUST NOT
no public identifier will
be generated.
-
escape-uri-attributes specifies whether the
processor
serializer
SHOULD
is to
escape URI-valued attributes in HTML and XHTML output
using the method RECOMMENDED in [RFC2396] (section
2.4.1). The value MUST be yes or no.
If this parameter is not specified, the value is
implementation-defined.
-
include-content-type specifies whether the serialization
process is to add a
meta element in HTML and XHTML
output. The value MUST be yes or no.
If this parameter is not specified, the value is
implementation-defined.
-
indent specifies whether the
processor
serializer
MAY add
additional whitespace when outputting the instance of the data model;
the value MUST be yes or no
If this parameter is not specified, the value is
implementation-defined.
-
media-type specifies the media type (MIME
content type) [RFC2376]
of the data that results from outputting the instance of the data model;
the charset parameter
of the media type MUST
NOT be specified
explicitly
; instead, when the top-level media type is
text, a charset parameter SHOULD be added
according to the character encoding actually used by the output
method
If this parameter is not specified, the media type is
implementation-defined.
-
normalize-unicode
indicates whether or not the
serialization process SHOULD
MUST convert
requests conversion of
the serialized output to Unicode
Normalization Form C as specified in
[UNICODE-NORMALIZATION]. The value MUST be yes or
no.
If this parameter is not specified, the value is
implementation-defined.
-
omit-xml-declaration specifies whether the serialization
process SHOULD
MUST
is to output
an XML declaration., unless the declaration is
REQUIRED by the setting of either the encoding parameter or the
standalone parameter The value MUST be yes
or no
If this parameter is not specified, the value is
implementation-defined.
-
standalone specifies whether the
processor
serializer
SHOULD
MUST output a
standalone document declaration and what its value
SHOULD
MUST be;
is to emit a standalone document declaration and
the value of the declaration;
the value of the parameter MUST be
yes or no
delCIf this parameter is not specified,
a standalone
document declaration MUST NOT be output.
-
undeclare-namespaces specifies whether
namespaces,
SHOULDMUST
are to
be undeclared during serialization; the value MUST be
yes or no.
If this parameter is not specified, the value is
implementation-defined.
This parameter only applies when the XML
serialization method is used and the version is greater than 1.0.
-
use-character-maps
provides
specifies
a list of character/string
pairs that are used in serialization (see [character-maps]).
If this parameter is not specified, no character maps are used.
-
version specifies the version of the output
method
If this parameter is not specified, the value is
implementation-defined.
The method parameter identifies the overall output method
that MUST be used for serializing. The value of the method
parameter MUST be a valid QName. If the QName is in no namespace,
then it identifies a method specified in this document and MUST be one
of xml, html, xhtml, or
text; in this case, the output method
specified MUST be used for serializing.
If the QName is in a namespace, then it identifies
an
implementation-defined
output method; the behavior in this case is not specified by this
document.
addGIn those cases where they have no important
effect on the content of the serialized result, details of the
output methods defined by this specification are left unspecified
and are regarded as implementation-dependent.
Whether a serializer uses
apostrophes or quotation marks to delimit attribute values in the
XML output method is an example of such a detail.
The detailed semantics of each parameter will be described
separately for each output method for which it is applicable. If the
semantics of a parameter are not described for an output method, then
it is not applicable to that output method.
|