From 61fc1716e0e697c67be538c546c1fa14d6adf053 Mon Sep 17 00:00:00 2001 From: Michael Kay Date: Wed, 15 Jan 2025 00:01:35 +0000 Subject: [PATCH] Minor changes following review of diff rendition --- .../src/xpath-datamodel.xml | 2 +- .../src/function-catalog.xml | 30 ++++++++-------- .../src/xpath-functions.xml | 6 ++-- specifications/xquery-40/src/expressions.xml | 34 +++++++------------ specifications/xslt-40/src/xslt.xml | 6 ++-- .../src/xslt-xquery-serialization.xml | 9 +++++ 6 files changed, 42 insertions(+), 45 deletions(-) diff --git a/specifications/xpath-datamodel-40/src/xpath-datamodel.xml b/specifications/xpath-datamodel-40/src/xpath-datamodel.xml index f2b6e53e7..1753e6acc 100644 --- a/specifications/xpath-datamodel-40/src/xpath-datamodel.xml +++ b/specifications/xpath-datamodel-40/src/xpath-datamodel.xml @@ -1511,7 +1511,7 @@ must equal the function’s arity. Constructors are added, and the single accessor function is now an iterator over the key/value pairs in the map. - Ordered maps are introduced. + Ordered maps are introduced.

A map item diff --git a/specifications/xpath-functions-40/src/function-catalog.xml b/specifications/xpath-functions-40/src/function-catalog.xml index e3f57a71a..3a507484d 100644 --- a/specifications/xpath-functions-40/src/function-catalog.xml +++ b/specifications/xpath-functions-40/src/function-catalog.xml @@ -12795,7 +12795,7 @@ else QName("", $value) instance of xs:NCName. For the default namespace, which has no prefix, the key is the zero-length string as an instance of xs:string.

-

The ordering of the returned map is .

+

The order of entries in the returned map is .

@@ -16521,8 +16521,7 @@ declare function equal-strings( -

It is not required that both maps have the same ordering property, - nor that the order of entries matches.

+

It is not required that the order of entries in the two maps should be the same.

All the following conditions are true:

@@ -23339,8 +23338,7 @@ map:build($input, map:get(?, 'key'), map:get(?, 'value'), $combine)

If the input is an empty sequence, the result is an empty map.

-

Except when ordering=sorted, - there is no requirement that the supplied key-value pairs should have the same or compatible +

There is no requirement that the supplied key-value pairs should have the same or compatible types. The type of a map (for example map(xs:integer, xs:string)) is descriptive of the entries it currently contains, but is not a constraint on how the map may be combined with other maps.

@@ -24068,7 +24066,7 @@ declare function map:find($input as item()*, -

Enhanced to allow for ordered maps.

+

Enhanced to allow for ordered maps.

@@ -24138,7 +24136,7 @@ declare function map:find($input as item()*,

There is no requirement that the type of $key and $value be consistent with the types of any existing keys and values in the supplied map.

-

With an ordered map, you can force the new entry to go at the end of the sequence by calling +

It is possible to force the new entry to go at the end of the sequence by calling map:remove before calling map:put.

@@ -24175,7 +24173,7 @@ declare function map:find($input as item()*, -

Enhanced to allow for ordered maps.

+

Enhanced to allow for ordered maps.

@@ -24356,7 +24354,7 @@ map:filter($map, fn($k, $v) { not(some($keys, atomic-equal($k, ?))) }) -

Enhanced to allow for ordered maps.

+

Enhanced to allow for ordered maps.

@@ -24440,7 +24438,7 @@ return { -

Enhanced to allow for ordered maps.

+

Enhanced to allow for ordered maps.

@@ -24509,7 +24507,7 @@ map:for-each($map, fn($key, $value) {

The $predicate callback function may return an empty sequence (meaning false).

-

Enhanced to allow for ordered maps.

+

Enhanced to allow for ordered maps.

@@ -27398,7 +27396,7 @@ return document { - + Determines whether special characters are represented in the XDM output in backslash-escaped form. @@ -27540,7 +27538,7 @@ return document { { "x": 2, "y": 5 }.

If duplicate keys are encountered in a JSON object, they are handled as determined by the duplicates option defined above.

-

The order of entries is retained if the retain-order option is set to true.

+

The order of entries is retained.

A JSON array is transformed to an array whose members are the result of converting @@ -27698,8 +27696,8 @@ return document { specification gave the default value as true, but this appears to have been an error, since it was inconsistent with examples given in the specification and with tests in the test suite.

- -

An option is provided to retain the order of entries in maps.

+ +

The order of entries in maps is retained.

diff --git a/specifications/xpath-functions-40/src/xpath-functions.xml b/specifications/xpath-functions-40/src/xpath-functions.xml index e27c371fc..c1ef0df24 100644 --- a/specifications/xpath-functions-40/src/xpath-functions.xml +++ b/specifications/xpath-functions-40/src/xpath-functions.xml @@ -7662,7 +7662,7 @@ return Ordering of Maps - Ordered maps are introduced. + Ordered maps are introduced.

In 4.0, the entries in a map are ordered. The entry order of a map @@ -7774,7 +7774,7 @@ return

Formal Specification of Maps

The XDM data model () defines three primitive operations on maps:

-

dm:empty-map constructs an empty map with a given ordering property.

+

dm:empty-map constructs an empty map.

dm:map-put adds or replaces an entry in a map.

dm:iterate-map applies a supplied function to every entry in a map.

@@ -7786,7 +7786,7 @@ return
to be specified by reference to this function library, without risk of circularity.

There is one exception to this rule: for convenience, the notation {} is used to represent - an empty map, in preference to a call on dm:empty-map(ordering := 'undefined').

+ an empty map, in preference to a call on dm:empty-map().

The formal equivalents are not intended to provide a realistic way of implementating the functions (in particular, any real implementation might be expected to implement map:get diff --git a/specifications/xquery-40/src/expressions.xml b/specifications/xquery-40/src/expressions.xml index a49dba942..f62e997f2 100644 --- a/specifications/xquery-40/src/expressions.xml +++ b/specifications/xquery-40/src/expressions.xml @@ -19194,7 +19194,7 @@ processing with JSON processing.

Maps - Ordered maps are introduced. + Ordered maps are introduced.

@@ -19219,18 +19219,11 @@ processing with JSON processing.

see .

-

Maps in &language; have a property called , - which takes the value true or false; a map - is accordingly said to be ordered or unordered. +

Maps in &language; are ordered. The effect of this property is explained - in . In summary:

- -

In an unordered map, the order of entries - in the map is ; it may, for example, - be the result of a randomized hashing algorithm.

-

In an ordered map, the order of entries is predictable - and depends on the order in which they were added to the map.

-
+ in . + In an ordered map, the order of entries is predictable + and depends on the order in which they were added to the map.

@@ -19242,7 +19235,7 @@ processing with JSON processing.

map { 0: false(), 1: true() } can now be written { 0: false(), 1: true() }, provided it is used in a context where this creates no ambiguity. - The order of key-value + The order of key-value pairs in the map constructor is now retained in the constructed map. @@ -20578,13 +20571,12 @@ return $array?[count(.) ge 2] for each entry in the map, with the context value set to an item of type record(key as xs:anyAtomicType, value as item()*), in which the key and value fields represent the key and value of the map entry. - The context position is the position of the entry in the map (in an arbitrary ordering), + The context position is the position of the entry in the map + (in ), and the context size is the number of entries in the map. The result of the expression is a map containing those entries of the input map for which the of the FILTER expression is true. - The ordered property of the result is the same as the ordered - property of the input map, and in the case of an ordered map, the relative order of - entries in the result retains the relative order of entries in the input. + The relative order of entries in the result retains the relative order of entries in the input.

For example, the following expression:

@@ -20597,11 +20589,9 @@ return $map?[?key ge 2] { 2: "beta", 3: "gamma" } -

Filtering of maps based on numeric positions is not generally useful when - the map is unordered, because the order of entries is unpredictable; but it is available - in the interests of orthogonality.

-

With an ordered map, a filter expression such as $map?[last()-1, last()] - might be used to return the last two entries.

+

A filter expression such as $map?[last()-1, last()] + might be used to return the last two entries of a map in + .

diff --git a/specifications/xslt-40/src/xslt.xml b/specifications/xslt-40/src/xslt.xml index 78bd5a905..0fd698a9f 100644 --- a/specifications/xslt-40/src/xslt.xml +++ b/specifications/xslt-40/src/xslt.xml @@ -35560,9 +35560,9 @@ the same group, and the--> now raises error XTSE3185 (rather than XTSE3280) if both a select attribute and a sequence constructor are present.
- - - Ordered maps are introduced. + + Ordered maps are introduced. +

Two instructions are added to XSLT to facilitate the construction of maps.

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 ee6fefe2f..157daef61 100644 --- a/specifications/xslt-xquery-serialization-40/src/xslt-xquery-serialization.xml +++ b/specifications/xslt-xquery-serialization-40/src/xslt-xquery-serialization.xml @@ -3408,6 +3408,9 @@ is described in .

Added the json-lines parameter for JSON serialization. + + The serialization of maps retains the order of entries. +

The JSON output method serializes the @@ -3727,6 +3730,12 @@ according to the format and as described in Adaptive Output Method + + + + The serialization of maps retains the order of entries. + +

The Adaptive output method serializes the into a human readable form for the purposes of debugging query results.