From 4ae8bfea45ab6c92ae14e5b037339d84c3db0e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gr=C3=BCn?= Date: Wed, 13 Dec 2023 19:05:03 +0100 Subject: [PATCH 1/3] 895 Parameters with default values: allow empty sequences --- .../src/function-catalog.xml | 141 +++++++++--------- 1 file changed, 73 insertions(+), 68 deletions(-) diff --git a/specifications/xpath-functions-40/src/function-catalog.xml b/specifications/xpath-functions-40/src/function-catalog.xml index 995255f28..2d0308a28 100644 --- a/specifications/xpath-functions-40/src/function-catalog.xml +++ b/specifications/xpath-functions-40/src/function-catalog.xml @@ -1341,7 +1341,7 @@ - + @@ -1368,9 +1368,9 @@ $value is an instance of xs:decimal and $precision is less than one, then the result may be an instance of xs:integer.

-

The single-argument version of this function produces the same result as the - two-argument version with $precision=0 (that is, it rounds to a whole - number).

+

If the second argument is omitted or an empty sequence, + the function produces the same result as the two-argument version with + $precision=0 (that is, it rounds to a whole number).

When $value is of type xs:float and xs:double:

@@ -1450,7 +1450,7 @@ - + @@ -1477,8 +1477,9 @@ $value is an instance of xs:decimal and $precision is less than one, then the result may be an instance of xs:integer.

-

The one-argument form of this function produces the same result as the two-argument form - with $precision=0.

+

If the second argument is omitted or an empty sequence, + the function produces the same result as the two-argument version with + $precision=0.

For arguments of type xs:float and xs:double:

@@ -2324,7 +2325,7 @@ - + @@ -3868,7 +3869,7 @@ return normalize-unicode(concat($v1, $v2)) - + @@ -3881,7 +3882,7 @@ return normalize-unicode(concat($v1, $v2)) separator between adjacent items.

-

The effect of calling the single-argument version of this function is the same as +

If the second argument is omitted or an empty sequence, the effect is the same as calling the two-argument version with $separator set to a zero-length string.

The function returns an xs:string created by casting each item @@ -4243,7 +4244,7 @@ return normalize-unicode(concat($v1, $v2)) - + @@ -4257,7 +4258,7 @@ return normalize-unicode(concat($v1, $v2))

If $value is the empty sequence, the function returns the zero-length string.

-

If the single-argument version of the function is used, the result is the same as +

If the second argument is omitted or an empty sequence, the result is the same as calling the two-argument version with $form set to the string "NFC".

Otherwise, the function returns $value normalized according to @@ -11173,7 +11174,7 @@ xs:dayTimeDuration($arg2) div xs:dayTimeDuration('PT1S') - + @@ -11194,8 +11195,9 @@ xs:dayTimeDuration($arg2) div xs:dayTimeDuration('PT1S')

The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument.

-

The language of the argument $node, or the context item if the second - argument is omitted, is determined by the value of the xml:lang attribute +

The language of the argument $node (or the context item if the second + argument is omitted or an empty sequence) + is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function @@ -12955,7 +12957,7 @@ return error((), 'Duplicate IDs found: ' || string-join($ids, ', ')) - + @@ -13071,7 +13073,7 @@ return starts-with-subsequence( - + @@ -13185,7 +13187,7 @@ return ends-with-subsequence( - + @@ -13469,7 +13471,7 @@ return contains-subsequence( - + @@ -14865,7 +14867,7 @@ else $c[1] + sum(subsequence($c, 2)) - + @@ -14892,8 +14894,8 @@ else $c[1] + sum(subsequence($c, 2)) E is in the target document. The target document is the document containing $node, or the document containing the context item (.) if the second argument is omitted. The behavior of the - function if $node is omitted is exactly the same as if the context - item had been passed as $node.

+ function if $node is omitted or an empty sequence is exactly the + same as if the context item had been passed as $node.

E has an ID value equal to one of the candidate @@ -15037,7 +15039,7 @@ else $c[1] + sum(subsequence($c, 2)) - + @@ -15072,8 +15074,9 @@ else $c[1] + sum(subsequence($c, 2))

E is in the target document. The target document is the document containing $node, or the document containing the context item - (.) if the second argument is omitted. The behavior of the - function if $node is omitted is exactly the same as if the context + (.) if the second argument is omitted or an empty sequence. + The behavior of the function if $node is omitted or an empty sequence + is exactly the same as if the context item had been passed as $node.

@@ -15212,7 +15215,7 @@ else $c[1] + sum(subsequence($c, 2)) - + @@ -15237,10 +15240,10 @@ else $c[1] + sum(subsequence($c, 2))

$N is in the target document. The target document is the document - containing $node or the document containing the context item + containing $node, or the document containing the context item (.) if the second argument is omitted. The behavior of the - function if $node is omitted is exactly the same as if the context - item had been passed as $node.

+ function if $node is omitted or an empty sequence is exactly the + same as if the context item had been passed as $node.

$N has an IDREF value equal to one of the candidate @@ -16946,7 +16949,7 @@ else $c[1] + sum(subsequence($c, 2)) - - + @@ -19457,8 +19460,8 @@ declare function transitive-closure ( -

The effect of calling the single-argument function is the same as the effect of - calling the two-argument function with an empty map as the value of $options.

+

If the second argument is omitted or an empty sequence, the effect is the same as + calling the two-argument function with an empty map as the value of $options.

The $options argument can be used to control the way in which duplicate keys are handled. @@ -19861,7 +19864,7 @@ return fold-left($MAPS, map { }, - + @@ -21122,7 +21125,7 @@ return $M(collation-key("a", $C)) - + @@ -21135,8 +21138,8 @@ return $M(collation-key("a", $C)) of an XML document node.

-

The effect of the one-argument form of this function is the same as calling the - two-argument form with an empty map as the value of the $options +

If the second argument is omitted or an empty sequence, the result is the same as + calling the two-argument form with an empty map as the value of the $options argument.

The first argument is a JSON-text as defined in - + @@ -21489,8 +21492,8 @@ return $M(collation-key("a", $C)) in this specification, into a string conforming to the JSON grammar.

-

The effect of the one-argument form of this function is the same as calling the - two-argument form with an empty map as the value of the $options +

If the second argument is omitted or an empty sequence, the result is the same as + calling the two-argument form with an empty map as the value of the $options argument.

The first argument $node is a node; the subtree rooted at this node will typically be @@ -21801,7 +21804,7 @@ return $M(collation-key("a", $C)) - + @@ -21816,8 +21819,8 @@ return $M(collation-key("a", $C)) csv-row-record records.

-

The effect of the one-argument form of this function is the same as calling the - two-argument form with an empty map as the value of the $options +

If the second argument is omitted or an empty sequence, the result is the same as + calling the two-argument form with an empty map as the value of the $options argument.

The first argument is CSV data, as defined in , in the form of a @@ -22223,7 +22226,7 @@ return $M(collation-key("a", $C)) - + @@ -22235,8 +22238,8 @@ return $M(collation-key("a", $C))

Parses CSV data supplied as a string, returning the results in the form of a sequence of arrays of strings.

-

The effect of the one-argument form of this function is the same as calling the - two-argument form with an empty map as the value of the $options +

If the second argument is omitted or an empty sequence, the result is the same as + calling the two-argument form with an empty map as the value of the $options argument.

The first argument is CSV data, as defined in , in the form of a @@ -22409,7 +22412,7 @@ return $M(collation-key("a", $C)) - + @@ -22422,8 +22425,8 @@ return $M(collation-key("a", $C)) .

-

The effect of the one-argument form of this function is the same as calling the - two-argument form with an empty map as the value of the $options +

If the second argument is omitted or an empty sequence, the result is the same as + calling the two-argument form with an empty map as the value of the $options argument.

The first argument is CSV data, as defined in , in the form of a @@ -22826,7 +22829,7 @@ return $M(collation-key("a", $C)) - + @@ -22839,8 +22842,8 @@ return $M(collation-key("a", $C)) of a map or array.

-

The effect of the one-argument form of this function is the same as calling the - two-argument form with an empty map as the value of the $options +

If the second argument is omitted or an empty sequence, the result is the same as + calling the two-argument form with an empty map as the value of the $options argument.

The first argument is a JSON text as defined in - + @@ -23162,8 +23165,9 @@ return $M(collation-key("a", $C))

Reads an external resource containing JSON, and returns the result of parsing the resource as JSON.

-

The effect of the single-argument call fn:json-doc($H) is the same as the effect of the two-argument call - fn:json-doc($H, map{}) where an empty map is supplied as the second argument.

+

If the second argument is omitted or an empty sequence, the result is the same as + calling the two-argument form with an empty map as the value of the $options + argument.

The effect of the two-argument function call fn:json-doc($H, $M)is equivalent to the function composition fn:unparsed-text($H) => fn:parse-json($M); except that:

@@ -23213,7 +23217,7 @@ return $M(collation-key("a", $C)) - + @@ -25395,7 +25399,7 @@ declare function flatten( - + @@ -25409,8 +25413,9 @@ declare function flatten(

The function loads an implementation-defined set of modules having the target namespace $module-uri.

-

Calling the one-argument version of the function has the same effect as calling the two-argument version with an empty map - as the second argument.

+

If the second argument is omitted or an empty sequence, the result is the same as + calling the two-argument form with an empty map as the value of the $options + argument.

The $options argument can be used to control the way in which the function operates. The option parameter conventions apply.

@@ -26503,7 +26508,7 @@ r:random-sequence(200); - @@ -26526,8 +26531,8 @@ every $boolean in (
-

If the second argument is omitted, the first argument must be a sequence of - xs:boolean values.

+

If the second argument is omitted or an empty sequence, the first argument must be + a sequence of xs:boolean values.

The implementation may deliver a result as soon as one item is found for which the predicate returns false; it is not required to evaluate the predicate for every item.

@@ -27465,7 +27470,7 @@ subsequence($input, 1, head(index-where($input, $predicate)) + 1) - @@ -27487,8 +27492,8 @@ some $boolean in ( ]]>
-

If the second argument is omitted, the first argument must be a sequence of xs:boolean - values.

+

If the second argument is omitted or an empty sequence, the first argument must be + a sequence of xs:boolean values.

The implementation may deliver a result as soon as one item is found for which the predicate returns true; it is not required to evaluate the predicate for every item.

@@ -27744,7 +27749,7 @@ some $boolean in ( - + @@ -28524,7 +28529,7 @@ path with an explicit file: scheme.

"port": (), "path": "/specifications/index.html" }'/> - + @@ -28806,7 +28811,7 @@ path with an explicit file: scheme.

- + From f03e0422d952bbbed9ae9cd73666328f92471b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gr=C3=BCn?= Date: Wed, 13 Dec 2023 19:16:16 +0100 Subject: [PATCH 2/3] =?UTF-8?q?type-ref=3D'parse-html-options=3F'=20?= =?UTF-8?q?=E2=86=92=20'parse-html-options'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- specifications/xpath-functions-40/src/function-catalog.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specifications/xpath-functions-40/src/function-catalog.xml b/specifications/xpath-functions-40/src/function-catalog.xml index 2d0308a28..90a834cf2 100644 --- a/specifications/xpath-functions-40/src/function-catalog.xml +++ b/specifications/xpath-functions-40/src/function-catalog.xml @@ -16949,7 +16949,7 @@ else $c[1] + sum(subsequence($c, 2)) - - +