diff --git a/specifications/xslt-40/src/element-catalog.xml b/specifications/xslt-40/src/element-catalog.xml index dbab33dc5..b7be3529b 100644 --- a/specifications/xslt-40/src/element-catalog.xml +++ b/specifications/xslt-40/src/element-catalog.xml @@ -1864,6 +1864,11 @@ + + + + + @@ -1984,6 +1989,9 @@ + + + diff --git a/specifications/xslt-40/src/schema-for-xslt40.xsd b/specifications/xslt-40/src/schema-for-xslt40.xsd index afa2278b6..4867e859c 100644 --- a/specifications/xslt-40/src/schema-for-xslt40.xsd +++ b/specifications/xslt-40/src/schema-for-xslt40.xsd @@ -1432,6 +1432,7 @@ of problems processing the schema using various tools + @@ -1650,6 +1651,7 @@ of problems processing the schema using various tools + diff --git a/specifications/xslt-40/src/xslt.xml b/specifications/xslt-40/src/xslt.xml index ad32f7be8..70e514d46 100644 --- a/specifications/xslt-40/src/xslt.xml +++ b/specifications/xslt-40/src/xslt.xml @@ -37194,6 +37194,7 @@ return ($m?price - $m?discount) doctype-system, encoding, escape-solidus escape-uri-attributes, html-version, indent, item-separator, + json-lines json-node-output-method, media-type, normalization-form, omit-xml-declaration, standalone, suppress-indentation, @@ -38521,6 +38522,12 @@ return ($m?price - $m?discount) yes. [XSLT 3.0 Erratum E14, bug 30208].

+ +

The value of the json-lines attribute determines whether the JSON + output method should output multiple JSON values in json-lines format (one + value per line). The default value is no. +

+

The value of the media-type attribute provides the value of the media-type parameter to the serialization method. The default diff --git a/specifications/xslt-xquery-serialization-40/src/xslt-xquery-serialization.xml b/specifications/xslt-xquery-serialization-40/src/xslt-xquery-serialization.xml index 33a05d709..80429956c 100644 --- a/specifications/xslt-xquery-serialization-40/src/xslt-xquery-serialization.xml +++ b/specifications/xslt-xquery-serialization-40/src/xslt-xquery-serialization.xml @@ -655,6 +655,10 @@ is performed. Host languages MAY they are not REQUIRED to be able to do so. However, the host language specification MUST specify how the values of all applicable parameters are to be determined.

+

Host languages may also define alternative representations of the values of serialization parameters. For example, both XSLT + and XQuery allow the boolean values true and false to be written as 1/0 + or yes/no. The $options map passed to the fn:serialize function, + by contrast, requires an xs:boolean value.

It is a serialization error if a parameter value is invalid for the given parameter. It is the responsibility of the host language to specify how invalid values should be handled at the level of that language.

The following serialization parameters are defined:

@@ -668,15 +672,14 @@ is the responsibility of the host language allow-duplicate-names -One of the enumerated values -yes, no, true, false, 1 or 0. +A boolean value, true or false. This parameter indicates whether a map item serialized as a JSON object using the JSON output method is -allowed to contain duplicate member names. If the value no, false or 0 +allowed to contain duplicate member names. If the value false is specified, a serialization error may be raised under certain conditions. -byte-order-markOne of the enumerated values -yes, no, true, false, 1 or 0. +byte-order-markA boolean value, + true or false. This parameter indicates whether the serialized sequence of octets is to be preceded by a Byte Order Mark (See Section 5.1 of @@ -710,29 +713,25 @@ This parameter MAY be absent. escape-solidus - One of the enumerated values - yes, no, true, false, 1 or 0. + A boolean value, true or false. escape-uri-attributes -One of the enumerated values -yes, no, true, false, 1 or 0. +A boolean value, true or false. html-version A decimal value. This parameter MAY be absent. -include-content-typeOne of the enumerated values -yes, no, true, false, 1 or 0. +include-content-type + A boolean value, true or false. -indentOne of the enumerated values -yes, no, true, false, 1 or 0. +indentA boolean value, true or false. item-separatorA string of Unicode characters. This parameter MAY be absent. -json-linesOne of the enumerated values -yes, no, true, false, 1 or 0. +json-linesA boolean value, true or false. @@ -785,11 +784,11 @@ output method; its behavior is not specified by this document. implementation-defined value of type NMTOKEN. -omit-xml-declarationOne of the enumerated values -yes, no, true, false, 1 or 0. +omit-xml-declaration + A boolean value, true or false. -standaloneOne of the enumerated values -yes, no, true, false, 1, 0 +standalone + Either a boolean value, true or false, or the value or omit. suppress-indentation @@ -797,8 +796,7 @@ or omit. undeclare-prefixes -One of the enumerated values -yes, no, true, false, 1 or 0. +A boolean value, true or false. use-character-maps @@ -862,7 +860,7 @@ that this specification leaves the output implementation-d namespace declarations on an element are written before or after the attributes of the element, or they might define the number of space or tab characters to be inserted when the indent parameter is set to -yes, true or 1; but they +true; but they could not instruct the serializer to suppress the error that occurs when the HTML output method encounters @@ -1263,7 +1261,7 @@ serialization parameters in an and processed using the mechanism described in this section, would specify the settings of the method, version and indent serialization parameters with the values -xml, 1.0 and yes, respectively. +xml, 1.0 and true, respectively.

and for additional information.

If the indent parameter has -one of the values yes, true or 1, +the value true,

additional text nodes consisting of whitespace characters MAY be present in the reconstructed tree; and

text nodes in the result tree that contained only whitespace @@ -1791,7 +1789,7 @@ reference. If a comment node contains the same character, a serializer MAY adjust the whitespace in the serialized result so that a person will find it easier to read. If the indent parameter has -one of the values yes, true or 1, +the value true, the serializer MAY output whitespace characters in addition to the whitespace characters in the . It MAY also elide from the output whitespace @@ -1813,10 +1811,10 @@ of that element.

If the -indent parameter has the value no, false or 0, the +indent parameter has the value false, the serializer MUST NOT add, elide or replace whitespace characters in the output. If the indent parameter has -one of the values yes, true or 1, +the value true, the serializer MUST use an algorithm for dealing with whitespace characters that satisfies all of the following constraints. @@ -1933,12 +1931,12 @@ have been explicitly requested by the user, either by using the attempts to preserve CDATA sections present in the source document.

A serializer MAY provide an implementation-defined mechanism to place CDATA sections in the result tree. XML Output Method: the omit-xml-declaration and standalone Parameters

The XML output method -MUST output an XML declaration if the omit-xml-declaration parameter has the value no, false or 0. +MUST output an XML declaration if the omit-xml-declaration parameter has the value false. The XML declaration MUST include both version information and an encoding declaration. If the standalone parameter has -one of the values yes, true, 1, no, false or 0, -the XML declaration MUST include a standalone document declaration with the same value as the value of the standalone parameter. - +the value true or false, +the XML declaration MUST include a standalone document declaration + with the value of the standalone parameter set accordingly to yes or no. If the standalone parameter has the value omit, the XML declaration MUST NOT include a standalone document declaration; this ensures @@ -1947,7 +1945,7 @@ document entity) and a text declaration (allowed at the beginning of an external general parsed entity).

A serialization error results if the omit-xml-declaration parameter has -one of the values yes, true or 1, and

+the value true, and

the standalone parameter has a value other than omit; or

@@ -1958,7 +1956,7 @@ parameter is specified.

Otherwise, if the omit-xml-declaration parameter has -one of the values yes, true or 1, +the true, the XML output method MUST NOT output an XML declaration.

@@ -1984,12 +1982,12 @@ have a child element node that does not bind that same prefix. In Namespaces in XML 1.1 (), this can be represented accurately by undeclaring prefixes. For the undeclaring prefix of the child element node, if the undeclare-prefixes parameter has -one of the values yes, true or 1, +the value true, the output method is XML or XHTML, and the version parameter value is greater than 1.0, the serializer MUST undeclare its namespace. If the -undeclare-prefixes parameter has the value no, false or 0 and the output method is XML or +undeclare-prefixes parameter has the value false and the output method is XML or XHTML, then the undeclaration of prefixes MUST NOT occur.

Consider an element x:foo with four in-scope namespaces that associate prefixes with URIs as follows:

x is associated with @@ -2012,7 +2010,7 @@ that associate prefixes with URIs as follows: </x:foo>

In Namespaces in XML 1.0 (), prefix undeclaration is not possible. If the output method is XML or XHTML, the value of the undeclare-prefixes parameter is -one of yes, true or 1, +true, and the value of the version parameter is 1.0, a serialization error results; the serializer MUST raise the error.

@@ -2067,7 +2065,7 @@ applicable to the XML output method. See for more information.

The byte order mark may be undesirable under certain circumstances, for example, to concatenate resulting XML fragments without additional processing to remove the byte order mark. Therefore this specification does not mandate the byte-order-mark parameter to have -one of the values yes, true or 1 +the value true when the encoding is UTF-16, even though the XML 1.0 and XML 1.1 specifications state that entities encoded in UTF-16 MUST begin with a byte order mark. Consequently, this specification does not guarantee that the resulting XML fragment, @@ -2429,7 +2427,7 @@ or the requirements of and .

XHTML Output Method: the indent and suppress-indentation Parameters

If the indent parameter has -one of the values yes, true or 1, the +the value true, the serializer MAY add or remove whitespace as it serializes the result tree, if it observes the following constraints.

@@ -2539,7 +2537,7 @@ name of the element.

XHTML Output Method: the escape-uri-attributes Parameter

If the escape-uri-attributes parameter has -one of the values yes, true or 1, +the value true, the XHTML output method MUST apply URI escaping to URI attribute values, except that relative URIs MUST NOT be absolutized.

This escaping is deliberately confined to non-ASCII characters, @@ -2548,14 +2546,14 @@ example when URIs or URI fragments are interpreted locally by the HTML user agent. Even in the case of non-ASCII characters, escaping can sometimes cause problems. More precise control of URI escaping is therefore available by setting escape-uri-attributes to -no, and controlling the escaping of URIs by using methods defined in +false, and controlling the escaping of URIs by using methods defined in and .

XHTML Output Method: the include-content-type Parameter

If the includes a head element recognized as an HTML element, and the include-content-type parameter has -one of the values yes, true or 1, +the value true, the XHTML output method MUST add a meta element as the first child element of the @@ -3064,7 +3062,7 @@ raise a serialization error

If the indent parameter has -one of the values yes, true or 1, +the value true, then the HTML output method MAY add or remove whitespace as it serializes the result tree, @@ -3188,7 +3186,7 @@ applicable to the HTML output method. See HTML Output Method: the escape-uri-attributes Parameter

If the escape-uri-attributes parameter -has one of the values yes, true or 1, +has the value true, the HTML output method MUST apply URI escaping to URI attribute values, except that relative URIs MUST NOT be absolutized. @@ -3198,11 +3196,11 @@ example when URIs or URI fragments are interpreted locally by the HTML user agent. Even in the case of non-ASCII characters, escaping can sometimes cause problems. More precise control of URI escaping is therefore available by setting escape-uri-attributes to -no, and controlling the escaping of URIs by using methods defined in +false, and controlling the escaping of URIs by using methods defined in and .

HTML Output Method: the include-content-type Parameter

If there is a head element, and the include-content-type parameter has -one of the values yes, true or 1, +the value true, the HTML output method MUST add a meta element as the first child element @@ -3420,12 +3418,14 @@ is described in .

-

If the value is one of yes, true or 1, - each item of the input value becomes a separate list entry. +

If the value is true, + each item of the input value becomes a separate list entry. If the input value + is an empty sequence, the serialized result is empty.

-

For all other values, the input value becomes a single list entry.

+

If the value is false, the input value becomes a single list entry. If + the input value is an empty sequence, the serialized result is the string null.

@@ -3462,7 +3462,7 @@ serialized output is string value, serialization error is raised, unless the allow-duplicate-names parameter has -one of the values yes, true or 1. +the value true.

@@ -3472,7 +3472,7 @@ is serialized to a JSON string by outp the result of serializing the node using the method specified by the json-node-output-method parameter. The node is serialized with the serialization parameter omit-xml-declaration set - to yes and with no other serialization parameters set. + to true and with no other serialization parameters set.

@@ -3553,8 +3553,8 @@ range 1-31 or 127-159 by an escape in the form \uHHHH where HHHH is the hexadecimal representation of the codepoint value. Escaping further replaces the solidus character (/) by the escape sequence \/ if the escape-solidus parameter - is set to true, yes, or 1, but not if it is - set to false, no, or 0. + is set to true, but not if it is + set to false. Escaping is also applied to any characters that cannot be represented in the selected encoding.

The resulting string is enclosed in double quotation marks.

@@ -3572,7 +3572,7 @@ converts the character stream produced by the preceding rules into an octet stre When nodes are serialized using the JSON output method, serialization is delegated to the output method specified by the json-node-output-method serialization parameter. The -omit-xml-declaration parameter is set to yes, and no other +omit-xml-declaration parameter is set to true, and no other serialization parameters are passed down to the serialization method responsible for serializing the node.

@@ -3618,13 +3618,13 @@ definition of JSON in .

-JSON Output Method: the indent and suppress-indentation Parameters +JSON Output Method: the indent Parameter

The indent parameter controls whether the serializer adjusts the whitespace in the serialized result so that a person will find it easier to read. If the indent parameter has -one of the values yes, true or 1, +the value true, the serializer MAY output additional whitespace characters adjacent to the JSON structural @@ -3632,8 +3632,8 @@ tokens. For all other values, the serializer MUST output no whitespace characters adjacent to the JSON structural tokens.

-

If json-lines has one of the values yes, true or -1, indentation is allowed, but the output whitespace characters may not contain +

If indent and json-lines are both true, + additional whitespace is allowed, but it MUST NOT include the character U+000A.

@@ -3676,9 +3676,9 @@ the byte-order mark).

JSON Output Method: the escape-solidus Parameter

The escape-solidus parameter is - applicable to the JSON output method. If the value is yes, true, or 1, + applicable to the JSON output method. If the value is true, then the solidus character ("/") appearing in a string is escaped with a backslash - (as "\/"). If the value is no, false, or 0, + (as "\/"). If the value is false, then it is not escaped.

In previous versions of this specification, the solidus was always escaped. Although JSON does not require @@ -3693,10 +3693,10 @@ determines whether the presence of multiple keys in a map item with the same string value (e.g. the date 2014-10-01 and the string "2014-10-01") will or will not raise serialization error . If the value is -one of, yes, true or 1, +true, such duplicate keys will result in duplicate object-member names in the JSON output and no error will be raised because of the duplicate names. -If the value is no, false or 0, +If the value is false, such duplicate keys are an error ().

@@ -3710,7 +3710,7 @@ If the value is one of xml, xhtml, html o then the node is converted to a JSON string by serializing the node using the output method specified by this parameter. If the value is xml or xhtml then the node is serialised with the additional serialization parameter omit-xml-declaration -set to yes. +set to true.