8 Text Output Method

The Text output method serializes the instance of the data model by outputting the string value of the document node created by the markup generation step of the phases of serialization without any escaping.

A newline character in the instance of the data model MAY be output using any character sequence that is conventionally used to represent a line ending in the chosen system environment.

Note:

The rule just stated applies to newline characters (#xA); it does not apply to occurrences in the data model instance of carriage return (CR), NEL, or LINE SEPARATOR characters; these should be output literally, regardless of the conventions for line endings in the system environment.

To illustrate, the following table shows the expected output for various character sequences in environments which conventionally use #xA (LF, as in Linux systems), #xD followed by #xA (CR+LF, Windows), #xD (CR only, older versions of Mac OS), #x85 (NEL, some IBM operating systems), or #x2028 (LINE SEPARATOR) to separate lines:

Expected output for various character sequences
Input #xA systems #xD#xA systems #xD systems #x85 systems #x2028 systems
character #xD character #xD character #xD character #xD character #xD character #xD
character #xA character #xA string #xD + #xA character #xD character #x85 character #x2028
string #xD + #xA string #xD + #xA string #xD + #xD + #xA string #xD + #xD string #xD + #x85 string #xD + #x2028
string #xD + #xD + #xA string #xD + #xD + #xA string #xD + #xD + #xD + #xA string #xD + #xD + #xD string #xD + #xD + #x85 string #xD + #xD + #x2028

8.1 The Influence of Serialization Parameters upon the Text Output Method

8.1.1 Text Output Method: the version Parameter

The version parameter is not applicable to the Text output method.

8.1.2 Text Output Method: the html-version Parameter

The html-version parameter is not applicable to the Text output method.

8.1.3 Text Output Method: the encoding Parameter

The encoding parameter identifies the encoding that the Text output method MUST use to convert sequences of characters to sequences of bytes. Serializers are REQUIRED to support values of UTF-8 and UTF-16. A serialization error [err:SESU0007] occurs if the serializer does not support the encoding specified by the encoding parameter. The serializer MUST signal the error. If the instance of the data model contains a character that cannot be represented in the encoding that the serializer is using for output, the serializer MUST signal a serialization error [err:SERE0008].

8.1.4 Text Output Method: the indent and suppress-indentation Parameters

The indent and suppress-indentation parameters are not applicable to the Text output method.

8.1.5 Text Output Method: the cdata-section-elements Parameter

The cdata-section-elements parameter is not applicable to the Text output method.

8.1.6 Text Output Method: the omit-xml-declaration and standalone Parameters

The omit-xml-declaration and standalone parameters are not applicable to the Text output method.

8.1.7 Text Output Method: the doctype-system and doctype-public Parameters

The doctype-system and doctype-public parameters are not applicable to the Text output method.

8.1.8 Text Output Method: the undeclare-prefixes Parameter

The undeclare-prefixes parameter is not applicable to the Text output method.

8.1.9 Text Output Method: the normalization-form Parameter

The normalization-form parameter is applicable to the Text output method. The values NFC and none MUST be supported by the serializer. A serialization error [err:SESU0011] results if the value of the normalization-form parameter specifies a normalization form that is not supported by the serializer; the serializer MUST signal the error.

8.1.10 Text Output Method: the media-type Parameter

The media-type parameter is applicable to the Text output method. See 3 Serialization Parameters for more information.

8.1.11 Text Output Method: the use-character-maps Parameter

The use-character-maps parameter is applicable to the Text output method. See 11 Character Maps for more information.

8.1.12 Text Output Method: the byte-order-mark Parameter

The byte-order-mark parameter is applicable to the Text output method. See 3 Serialization Parameters for more information.

8.1.13 Text Output Method: the escape-uri-attributes Parameter

The escape-uri-attributes parameter is not applicable to the Text output method.

8.1.14 Text Output Method: the include-content-type Parameter

The include-content-type parameter is not applicable to the Text output method.

8.1.15 Text Output Method: the item-separator Parameter

The effect of the item-separator serialization parameter is described in 2 Sequence Normalization.

8.1.16 Text Output Method: the allow-duplicate-names Parameter

The allow-duplicate-names serialization parameter is not applicable to the Text output method.

8.1.17 Text Output Method: the json-node-output-method Parameter

The json-node-output-method serialization parameter is not applicable to the Text output method.