diff --git a/etc/status-general.xml b/etc/status-general.xml index c4c765e5a..1fc8c6bad 100644 --- a/etc/status-general.xml +++ b/etc/status-general.xml @@ -71,4 +71,10 @@ &patent-policy-paragraph; - \ No newline at end of file + +

The publications of this community group +are dedicated to our co-chair, +Michael Sperberg-McQueen (1954–2024).

+
+ + diff --git a/schema/common/.DS_Store b/schema/common/.DS_Store deleted file mode 100644 index f2435a548..000000000 Binary files a/schema/common/.DS_Store and /dev/null differ diff --git a/schema/common/mathml/.DS_Store b/schema/common/mathml/.DS_Store deleted file mode 100644 index 2a0d94453..000000000 Binary files a/schema/common/mathml/.DS_Store and /dev/null differ diff --git a/schema/common/mathml/mathml1/.DS_Store b/schema/common/mathml/mathml1/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/mathml/mathml1/.DS_Store and /dev/null differ diff --git a/schema/common/mathml/mathml2/.DS_Store b/schema/common/mathml/mathml2/.DS_Store deleted file mode 100644 index 258b7ce93..000000000 Binary files a/schema/common/mathml/mathml2/.DS_Store and /dev/null differ diff --git a/schema/common/mathml/mathml2/html/.DS_Store b/schema/common/mathml/mathml2/html/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/mathml/mathml2/html/.DS_Store and /dev/null differ diff --git a/schema/common/mathml/mathml2/iso8879/.DS_Store b/schema/common/mathml/mathml2/iso8879/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/mathml/mathml2/iso8879/.DS_Store and /dev/null differ diff --git a/schema/common/mathml/mathml2/iso9573-13/.DS_Store b/schema/common/mathml/mathml2/iso9573-13/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/mathml/mathml2/iso9573-13/.DS_Store and /dev/null differ diff --git a/schema/common/mathml/mathml2/mathml/.DS_Store b/schema/common/mathml/mathml2/mathml/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/mathml/mathml2/mathml/.DS_Store and /dev/null differ diff --git a/schema/common/mathml/mathml3/.DS_Store b/schema/common/mathml/mathml3/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/mathml/mathml3/.DS_Store and /dev/null differ diff --git a/schema/common/rddl/.DS_Store b/schema/common/rddl/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/rddl/.DS_Store and /dev/null differ diff --git a/schema/common/svg10/.DS_Store b/schema/common/svg10/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/svg10/.DS_Store and /dev/null differ diff --git a/schema/common/svg11/.DS_Store b/schema/common/svg11/.DS_Store deleted file mode 100644 index 8d6a5d0cb..000000000 Binary files a/schema/common/svg11/.DS_Store and /dev/null differ diff --git a/schema/common/svg11/templates/.DS_Store b/schema/common/svg11/templates/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/svg11/templates/.DS_Store and /dev/null differ diff --git a/schema/common/xhtml10/.DS_Store b/schema/common/xhtml10/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/xhtml10/.DS_Store and /dev/null differ diff --git a/schema/common/xhtml11/.DS_Store b/schema/common/xhtml11/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/xhtml11/.DS_Store and /dev/null differ diff --git a/schema/common/xmlschema/.DS_Store b/schema/common/xmlschema/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/xmlschema/.DS_Store and /dev/null differ diff --git a/schema/common/xmlspec/.DS_Store b/schema/common/xmlspec/.DS_Store deleted file mode 100644 index 5008ddfcf..000000000 Binary files a/schema/common/xmlspec/.DS_Store and /dev/null differ diff --git a/specifications/EXPath/binary/src/binary-functions.xml b/specifications/EXPath/binary/src/binary-functions.xml index b3de1054b..1b33544ce 100644 --- a/specifications/EXPath/binary/src/binary-functions.xml +++ b/specifications/EXPath/binary/src/binary-functions.xml @@ -233,6 +233,12 @@ for transition to Proposed Recommendation.

'> in their History notes. Comments are invited, in the form of GitHub issues at https://github.com/qt4cg/qtspecs.

+ + +

The publications of this community group +are dedicated to our co-chair, +Michael Sperberg-McQueen (1954–2024).

+
diff --git a/specifications/EXPath/file/src/file-functions.xml b/specifications/EXPath/file/src/file-functions.xml index f3853c6dc..ae93ded35 100644 --- a/specifications/EXPath/file/src/file-functions.xml +++ b/specifications/EXPath/file/src/file-functions.xml @@ -236,6 +236,12 @@ for transition to Proposed Recommendation.

'> in their History notes. Comments are invited, in the form of GitHub issues at https://github.com/qt4cg/qtspecs.

+ + +

The publications of this community group +are dedicated to our co-chair, +Michael Sperberg-McQueen (1954–2024).

+
diff --git a/specifications/grammar-40/xpath-grammar.xml b/specifications/grammar-40/xpath-grammar.xml index bcee17244..61f1cb012 100644 --- a/specifications/grammar-40/xpath-grammar.xml +++ b/specifications/grammar-40/xpath-grammar.xml @@ -1333,7 +1333,7 @@ VersionDecl ::= "xquery" (("encoding" StringLiteral) | ("version" StringLiteral ) - + @@ -1344,21 +1344,21 @@ VersionDecl ::= "xquery" (("encoding" StringLiteral) | ("version" StringLiteral - - - + + + - + @@ -1553,6 +1553,11 @@ ErrorVal ::= "$" VarName + + + -> + + diff --git a/specifications/image-sources/anyAtomicType.xml b/specifications/image-sources/anyAtomicType.xml index 0b05b556c..2d5b8725f 100644 --- a/specifications/image-sources/anyAtomicType.xml +++ b/specifications/image-sources/anyAtomicType.xml @@ -257,10 +257,15 @@ -

+

time

+ +

+ untypedAtomic +

+
diff --git a/specifications/image-sources/anyType.xml b/specifications/image-sources/anyType.xml index 8bb243bb9..5f3162a37 100644 --- a/specifications/image-sources/anyType.xml +++ b/specifications/image-sources/anyType.xml @@ -85,11 +85,17 @@

-

+

user-defined union types (user-defined)

+ +

+ user-defined enumeration types + (user-defined) +

+
diff --git a/specifications/image-sources/item-types.xml b/specifications/image-sources/item-types.xml index 75c7435dc..01d3b14b4 100644 --- a/specifications/image-sources/item-types.xml +++ b/specifications/image-sources/item-types.xml @@ -64,11 +64,40 @@

function(*) (function item)

+ +

+ user-defined function item types + (user-defined) +

+
+

array(*) (function item)

+ + +

+ user-defined array types + (user-defined) +

+
+

map(*) (function item)

+ + +

+ user-defined map types + (user-defined) +

+
+ +

+ user-defined record types + (user-defined) +

+
+
diff --git a/specifications/xpath-datamodel-40/src/xpath-datamodel.xml b/specifications/xpath-datamodel-40/src/xpath-datamodel.xml index e5bebcd7b..cbf407236 100644 --- a/specifications/xpath-datamodel-40/src/xpath-datamodel.xml +++ b/specifications/xpath-datamodel-40/src/xpath-datamodel.xml @@ -766,7 +766,7 @@ therefore can also be contained within sequences.

The dm:iterate-sequence accessor calls the supplied $action function once for each item in $input, in order, - and returns the sequence concenation of the results. The $action function + and returns the sequence concatenation of the results. The $action function is called with two arguments. The first argument is an item in $input, and the second is the 1-based ordinal position of the item within $input.

@@ -1511,21 +1511,21 @@ 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.

A map item -is a value that represents a map (in other languages this is sometimes -called a hash, dictionary, or associative array). - A map is logically a collection of -key/value pairs. Each key in the map is unique (there is no other key -to which it is equal) and has associated with it a value that is a sequence +is an item that represents an ordered sequence of key/value pairs, +in which the keys are unique. + In other languages this is sometimes +called a hash, dictionary, or associative array. + The keys are atomic items, and each key in the map is unique (there is no other key +to which it is equal). Each key is associated with a value that may be any sequence of zero or more items. There is no uniqueness constraint on -values. The semantics of equality are described in +values, only on keys. The semantics of equality when comparing keys are described in .

- - - - + +

Maps have no intrinsic identity separate from their content. A map can be given a transient identity, represented by an id property in its label, by applying the fn:pin function. This property is expected to be used in defining @@ -1533,18 +1533,27 @@ values. The semantics of equality are described in

+ + +

The order of entries in a map + is referred to as entry order. + The entry order affects the result of functions such as map:keys + and map:for-each, and also determines the order of entries + when a map is serialized using the JSON output method.

+ +

Constructor and accessor functions for maps are defined in the following sections.

empty-map Constructor - +

The dm:empty-map constructor returns a map containing no key/value pairs.

-

The function is exposed in XPath as an empty map constructor, which may be written {} - or map {}.

+

In XPath an empty map may be constructed using the expression {} + or map {}.

@@ -1565,7 +1574,13 @@ values. The semantics of equality are described in

One key/value pair whose key is $key and whose associated value is $value.

-

The function is exposed in XPath through the function map:put.

+ +

The in the returned + map reflects the in the supplied $map. If the key of + the new entry was present in $map then the new entry replaces that entry retaining + its current position; otherwise, the new entry is added after all existing entries.

+ +

The function is exposed in XPath through the function map:put.

@@ -1578,13 +1593,14 @@ values. The semantics of equality are described in -

The dm:iterate-map accessor calls the supplied $action - function once for each key/value pair in $map, in implementation-dependent order, - and returns the sequence concenation of the results.

+

The dm:iterate-map accessor calls the supplied $action + function once for each key/value pair in $map, + and returns the sequence concenation of the results. The order in which entries + are processed is the of the map.

-

The function is exposed in XPath most directly through the function map:for-each, but - it also underpins all other functions giving access to maps, such as map:size, - map:contains, and map:get.

+

The function is exposed in XPath most directly through the function map:for-each, but + it also underpins all other functions giving access to maps, such as map:size, + map:contains, and map:get.

diff --git a/specifications/xpath-functions-40/src/function-catalog.xml b/specifications/xpath-functions-40/src/function-catalog.xml index 0f41eb1bb..9e3e0f5e2 100644 --- a/specifications/xpath-functions-40/src/function-catalog.xml +++ b/specifications/xpath-functions-40/src/function-catalog.xml @@ -437,7 +437,7 @@

parameter names: ()

-

signature: () => map(xs:string, item())

+

signature: () => random-number-generator-record

non-local variable bindings: none

@@ -2065,6 +2065,10 @@ compare($N * $arg2, 0) eq compare($arg1, 0). $value.

+ +

There may be limits on the precision + available. If the requested $precision is outside this range, it should + be adjusted to the nearest value supported by the implementation.

@@ -2202,6 +2206,10 @@ compare($N * $arg2, 0) eq compare($arg1, 0).

A third argument has been added, providing control over the rounding mode.

+ +

It is explicitly stated that the limits for $precision + are implementation-defined.

+
@@ -2254,6 +2262,10 @@ compare($N * $arg2, 0) eq compare($arg1, 0). returned according to the sign of the original argument.

+ +

There may be limits on the precision + available. If the requested $precision is outside this range, it should + be adjusted to the nearest value supported by the implementation.

@@ -2314,6 +2326,12 @@ compare($N * $arg2, 0) eq compare($arg1, 0). + + +

It is explicitly stated that the limits for $precision + are implementation-defined.

+
+
@@ -2356,9 +2374,9 @@ compare($N * $arg2, 0) eq compare($arg1, 0). -

If $precision exceeds the maximum precision for xs:decimal - values supported by the implementation, then the maximum available precision is - used in its place.

+

There may be limits on the precision + available. If the requested $precision is outside this range, it should + be adjusted to the nearest value supported by the implementation.

@@ -12795,7 +12813,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 order of entries in the returned map is .

@@ -16521,6 +16539,7 @@ declare function equal-strings( +

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

All the following conditions are true:

@@ -23081,6 +23100,29 @@ xs:QName('xs:double') + @@ -23118,6 +23160,7 @@ return fold-left($maps, {}, /> if the value of $options includes an entry whose key is defined in this specification, and whose value is not a permitted value for that key.

+
@@ -23146,7 +23189,8 @@ return fold-left($maps, {},

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

If the input is a sequence of length one, the result map is indistinguishable from the supplied map.

-

There is no requirement that the supplied input maps should have the same or compatible +

There is no requirement that + the supplied input maps 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.

@@ -23217,6 +23261,12 @@ return fold-left($maps, {}, entry that appears in the result is the sequence concatenation of the entries in the input maps, retaining order. + + + map:merge(({ "red": 0 }, { "green": 1}, { "blue": 2 })) + => map:keys() + "red", "green", "blue" + @@ -23229,7 +23279,7 @@ return fold-left($maps, {}, type-ref="key-value-pair" type-ref-occurs="*" usage="inspection" example="{ 'key':'n','value':false() }, { 'key':'y','value':true() }"/> - + @@ -23249,9 +23299,47 @@ return fold-left($maps, {}, $input argument.

-

The optional $combine argument can be used to define how - duplicate keys should be handled. The default is to form the sequence concatenation - of the corresponding values, retaining their order in the input sequence.

+

The $options argument can be used to control the ordering of the result, + and the way in which duplicate keys are handled. + The option parameter conventions apply. +

+ +

The entries that may appear in the $options map are as follows:

+ + + + A function that is used to combine two different values that are supplied + for the same key. The default is to combine the two values using + , retaining their order + in the input sequence. + + (fn($existing-value as item()*, $new-value as item()*) as item()*)? + fn:op(',') + + + + + @@ -23259,6 +23347,8 @@ return fold-left($maps, {}, map:build($input, map:get(?, 'key'), map:get(?, 'value'), $combine) + +

The function can be made to fail with a dynamic error in the event that duplicate keys are present in the input sequence by supplying a $combine function that invokes the fn:error function.

@@ -23348,8 +23438,36 @@ map:build($input, map:get(?, 'key'), map:get(?, 'value'), $combine) In the result map, the value for key 6 is obtained by concatenating the values from the two input maps, with a separator character. + + + map:of-pairs((map:pair("red": 0), map:pair("green": 1), map:pair("blue": 2 )) + => map:keys() + "red", "green", "blue" + The keys are returned in the order supplied. + + + + { "red": 0, "green": 1, "blue": 2 } + => map:pairs() => sort(keys := fn{ ?key }) => map:of-pairs()) + => map:keys() + "blue", "green", "red" + Takes any map and produces a map with the same entries, but sorted by key. + + + + map:of-pairs((map:pair("red": 0), map:pair("green": 1), map:pair("blue": 2 )) + => map:put("yellow": -1) => map:keys() + "red", "green", "blue", "yellow" + New entries are added at the end. + + + +

The following expression takes an existing map and sorts its entries into key order:

+ map:of-pairs(map:pairs($M) => sort(keys:=fn{?key})) + +

New in 4.0

@@ -23363,7 +23481,7 @@ map:build($input, map:get(?, 'key'), map:get(?, 'value'), $combine) - nondeterministic-wrt-ordering + deterministic context-independent focus-independent @@ -23373,13 +23491,9 @@ map:build($input, map:get(?, 'key'), map:get(?, 'value'), $combine)

Informally, the function map:keys takes any map as its $map argument and returns - the keys that are present in the map as a sequence of atomic items, in implementation-dependent order.

-

The function is nondeterministic with respect to ordering - (see ). This means that two calls with the same argument - are not guaranteed to produce the results in the same order.

+ the keys that are present in the map as a sequence of atomic items, + in entry order.

+
map:for-each($map, fn($key, $value) { $key }) @@ -23391,10 +23505,12 @@ map:build($input, map:get(?, 'key'), map:get(?, 'value'), $combine) - map:keys({ 1: "yes", 2: "no" }) - (1, 2) - The result is in implementation-dependent order. + map:keys({ 1: "yes", 0: "no" }) + (1, 0) + + + map:keys(map:merge(({"red": 0}, {"blue": 1}, {"green": 2}))) + ("red", "blue", "green") @@ -23404,11 +23520,11 @@ map:build($input, map:get(?, 'key'), map:get(?, 'value'), $combine) - + - nondeterministic-wrt-ordering + deterministic context-independent focus-independent @@ -23420,15 +23536,17 @@ map:build($input, map:get(?, 'key'), map:get(?, 'value'), $combine) map as its $map argument. The $predicate function takes the key and the value of the corresponding map entry as an argument, and the result is a sequence containing the keys of those - entries for which the predicate function returns true in implementation-dependent order. - A return value of () is treated as false.

+ entries for which the predicate function returns true, in + entry order.

+ +

A return value of () from the predicate function is + treated as false.

-

The function is nondeterministic with respect to ordering + map:for-each($map, fn($key, $value) { @@ -23450,7 +23568,7 @@ return map:keys-where( fn($key, $value) { $value = ("two", "three") } ) - (2, 3) + (2, 3) @@ -23464,7 +23582,7 @@ return map:keys-where( fn($key, $value) { $value > 5 and $value < 20 } ) - (3, 4) + (3, 4) @@ -23499,24 +23617,19 @@ return map:keys-where($birthdays, fn($name, $date) { - nondeterministic-wrt-ordering + deterministic context-independent focus-independent -

Returns a sequence containing all the values present in a map, in unpredictable order.

+

Returns a sequence containing all the values present in a map, in order.

The function map:items takes any map as its $map argument and returns the values that are present in the map as - a sequence, in implementation-dependent order.

-

The function is nondeterministic with respect to ordering - (see ). This means that two calls with the same argument - are not guaranteed to produce the results in the same order.

+ a sequence, in entry order.

+

The effect of the function is equivalent to $map?*.

@@ -23526,9 +23639,7 @@ return map:keys-where($birthdays, fn($name, $date) { map:items({ 1: "yes", 2: "no" }) - ("yes", "no") - The result is in implementation-dependent order. + ("yes", "no") map:items({ @@ -23536,9 +23647,7 @@ return map:keys-where($birthdays, fn($name, $date) { 2: ("blue", "yellow"), 3: () }) - ("red", "green", "blue", "yellow") - The result is in implementation-dependent order. + ("red", "green", "blue", "yellow") @@ -23554,7 +23663,7 @@ return map:keys-where($birthdays, fn($name, $date) { - nondeterministic-wrt-ordering + deterministic context-independent focus-independent @@ -23566,14 +23675,10 @@ return map:keys-where($birthdays, fn($name, $date) {

The function map:entries takes any map as its $map argument and returns the key-value pairs that are present in the map as - a sequence of singleton maps, in implementation-dependent order.

+ a sequence of singleton maps, in + entry order.

+ -

The function is nondeterministic with respect to ordering - (see ). This means that two calls with the same argument - are not guaranteed to produce the results in the same order.

@@ -23583,11 +23688,9 @@ return map:keys-where($birthdays, fn($name, $date) { map:entries( - { 1: "yes", 2: "no" } + { 1: "yes", 0: "no" } ) - ({ 1: "yes" }, { 2: "no" }) - The result sequence is in implementation-dependent order. + ({ 1: "yes" }, { 0: "no" }) @@ -23603,7 +23706,7 @@ return map:keys-where($birthdays, fn($name, $date) { - nondeterministic-wrt-ordering + deterministic context-independent focus-independent @@ -23615,16 +23718,12 @@ return map:keys-where($birthdays, fn($name, $date) {

The function map:pairs takes any map as its $map argument and returns the keys that are present in the map as - a sequence of key-value pair maps, in implementation-dependent order.

+ a sequence of key-value pair maps, in + entry order.

A key-value pair map is an instance of type record(key as xs:anyAtomicType, value as item()*): that is a map with two entries, one (with key "key") holding the key, and the other (with key "value") holding the value.

-

The function is nondeterministic with respect to ordering - (see ). This means that two calls with the same argument - are not guaranteed to produce the results in the same order.

+ map:for-each($map, map:pair#2) @@ -23635,7 +23734,7 @@ return map:keys-where($birthdays, fn($name, $date) { map:pairs( { 1: "Y", 2: "N" } ) - ({ "key": 1, "value": "Y" }, { "key": 2, "value": "N" }) + ({ "key": 1, "value": "Y" }, { "key": 2, "value": "N" }) @@ -23644,8 +23743,6 @@ return map:keys-where($birthdays, fn($name, $date) { - The result is in implementation-dependent order. @@ -23653,6 +23750,47 @@ return map:keys-where($birthdays, fn($name, $date) {

New in 4.0

+ + @@ -23748,7 +23886,7 @@ return map:keys-where($birthdays, fn($name, $date) { - + @@ -23882,9 +24020,7 @@ return (

To process an item that is a map, then for each key-value entry (K, V) - in the map (in implementation-dependent order) + in the map (in entry order) perform both of the following steps, in order:

@@ -23962,6 +24098,9 @@ declare function map:find($input as item()*, + +

Enhanced to allow for ordered maps.

+
@@ -23988,6 +24127,12 @@ declare function map:find($input as item()*, def="dt-same-key" >same key as $key, together with a new entry whose key is $key and whose associated value is $value.

+ +

The entry order + of the entries in the returned map is as follows: + if $map contains an entry whose key is $key, + then the new value replaces the old value and the position of the entry is not changed; + otherwise, the new entry is added after all existing entries.

+ - - - + + + @@ -24504,11 +24633,56 @@ else map:put($map, $key, $action(())) Then, for each key value:

If the key is not already present in the target map, the processor adds a - new key-value pair to the map, with that key and that value.

-

If the key is already present, the processor calls the $combine - function to combine the existing value for the key with the new value, + new key-value pair to the map, with that key and that value.

+

If the key is already present, the processor calls the combine + function in the $options argument to combine the existing value for the key with the new value, and replaces the entry with this combined value.

+ +

The $options argument can be used to control the way in which duplicate keys are handled. + The option parameter conventions apply. +

+ +

The entries that may appear in the $options map are as follows:

+ + + + A function that is used to combine two different values that are supplied + for the same key. The default is to combine the two values using + . + + (fn($existing-value as item()*, $new-value as item()*) as item()*)? + fn:op(',') + + + + + + fold-left($input, {}, fn($map, $item, $pos) { @@ -24523,9 +24697,9 @@ fold-left($input, {}, fn($map, $item, $pos) { }) + -

Although defined to process the input sequence in order, this is only relevant when combining the entries - for duplicate keys.

+

The default function for both $keys and $value is the identity function. Although it is permitted to default both, this serves little purpose: usually at least one of these arguments will be supplied.

@@ -24540,6 +24714,10 @@ fold-left($input, {}, fn($map, $item, $pos) {

fn:concat(?, ",", ?) Form the string-concatenation of the values, comma-separated

fn:op('+') Compute the sum of the values

+

The order of entries in the result reflects + the order of the items in $input from which they were derived. In the + event that two entries have duplicate keys, the position of the combined entry + in the result reflects the position of the first input item with that key.

@@ -24585,7 +24763,7 @@ fold-left($input, {}, fn($map, $item, $pos) { ("apple", "apricot", "banana", "blueberry", "cherry"), substring(?, 1, 1), string-length#1, - op("+") + { "combine": op("+") } ) { "a": 12, "b": 15, "c": 6 } Constructs a map where the key is the first character of an input item, and where the corresponding value @@ -24641,7 +24819,7 @@ return map:build($titles/title, fn($title) { $title/ix })

The following expression creates a map whose keys are employee @location values, and whose corresponding values represent the number of employees at each distinct location. Any employees that lack an @location attribute will be excluded from the result.

- map:build(//employee, fn { @location }, fn { 1 }, op("+")) + map:build(//employee, fn { @location }, fn { 1 }, { "combine": op("+") })

The following expression creates a map whose keys are employee @location values, and whose @@ -24699,6 +24877,157 @@ return map:build($titles/title, fn($title) { $title/ix }) + + + + @@ -25325,8 +25654,8 @@ return $M(collation-key("a", $C))

The XDM tree returned by the function does not contain any unnecessary (albeit valid) nodes such as whitespace text nodes, comments, or processing instructions. It does not include any whitespace in the value of number or boolean - element nodes, or in the value of escaped or escaped-key - attribute nodes.

+ element nodes, nor in the value of escaped or escaped-key + attribute nodes.

If the result is typed, every element named string will have an attribute named @@ -25676,7 +26005,8 @@ return json-to-xml($json, $options)]]> the children of the map element, enclosed between curly braces and separated by commas. Each entry comprises the value of the key attribute of the child element, enclosed in quotation marks and escaped as described below, followed by a colon, followed by the result of processing the child element - by applying these rules recursively.

+ by applying these rules recursively. The order of properties in the output JSON representation retains the order + of the children of the map element.

Comments, processing instructions, and whitespace text node children of map and array @@ -27098,6 +27428,20 @@ return document { + + Determines whether special characters are represented in the XDM output in backslash-escaped form. @@ -27227,6 +27571,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.

A JSON array is transformed to an array whose members are the result of converting @@ -27384,7 +27729,9 @@ 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.

- + +

The order of entries in maps is retained.

+
@@ -33562,6 +33909,8 @@ return $result is derived from V by applying the function derived-value(M', K, V), defined below.

+

The + of M is retained in M'.

If $input is an array A, the result is an array A' diff --git a/specifications/xpath-functions-40/src/xpath-functions.xml b/specifications/xpath-functions-40/src/xpath-functions.xml index 2a81de662..8a7422e3d 100644 --- a/specifications/xpath-functions-40/src/xpath-functions.xml +++ b/specifications/xpath-functions-40/src/xpath-functions.xml @@ -216,6 +216,12 @@ for transition to Proposed Recommendation.

'> the W3C XSLT 4.0 Extensions Community Group. Individual functions specified in the document may be at different stages of review, reflected in their History notes. Comments are invited, in the form of GitHub issues at https://github.com/qt4cg/qtspecs.

+ + +

The publications of this community group +are dedicated to our co-chair, +Michael Sperberg-McQueen (1954–2024).

+
@@ -802,6 +808,7 @@ for transition to Proposed Recommendation.

'>

All entries in the options map are optional, and supplying an empty map has the same effect as omitting the relevant argument in the function call, assuming this is permitted.

+

The ordering of the options map is immaterial.

For each named option, the function specification defines a required type for the option value. The value that is actually supplied in the map is converted to this required type using the @@ -857,16 +864,19 @@ the relationship of various item types.

in declaring the types of variables or the argument types and result types of functions.

-

Item types in the data model form a directed graph, rather than a +

In XDM, item types include node types, +function types, and built-in atomic types. +Item types form a directed graph, rather than a hierarchy or lattice: in the relationship defined by the derived-from(A, B) function, some types are derived from more than one other type. Examples include functions (function(xs:string) as xs:int is substitutable for function(xs:NCName) as xs:int and also for -function(xs:string) as xs:decimal), and union types -(A is substitutable for the union type (A | B) and also -for (A | C). In XDM, item types include node types, -function types, and built-in atomic types. The diagram, which shows +function(xs:string) as xs:decimal), and choice types +(A is substitutable for the choice type (A | B) and also +for (A | C). Record types provide an alternative way of categorizing + maps: the instances of record(longitude, latitude) overlap with + the instances of map(xs:string, xs:double). The diagram, which shows only hierarchic relationships, is therefore a simplification of the full model.

@@ -6916,7 +6926,7 @@ correctly in all browsers, depending on the system configuration.

--> of numbers, the conversion is not guaranteed to retain full precision.

Although the order of entries in a JSON object is generally considered to have no significance, the functions - json-to-xml and json-to-xml both retain order.

+ json-to-xml and xml-to-json both retain order.

The XDM representation of a JSON value may either be untyped (all elements annotated as xs:untyped, attributes as xs:untypedAtomic), or it may be typed. If it is typed, then it must have the type @@ -7620,12 +7630,13 @@ return Maps +

Maps were introduced as a new datatype in XDM 3.1. This section describes functions that operate on maps.

-

A map is an additional kind of item.

+

A map is a kind of item.

-

A map consists of a set of entries, also known +

A map consists of a sequence of entries, also known as key-value pairs. Each entry comprises a key which is an arbitrary atomic item, and an arbitrary sequence called the associated value.

@@ -7653,6 +7664,41 @@ return
The fact that a map is a function item allows it to be passed as an argument to higher-order functions that expect a function item as one of their arguments.

+ + Ordering of Maps + + + Ordered maps are introduced. + + +

In 4.0, the entries in a map are ordered. The entry order of a map + is referred to as entry order.

+

The entry order of the entries in a map is defined by the function or expression + that creates the map, and affects the result of functions and expressions + that process multiple entries in a map, for example the function map:keys + and the expression + for key $k value $v return EXPR. The ordering + is also reflected in the output + of the json and adaptive serialization methods.

+ + +

Order is maintained in maps for two main reasons:

+ +

To make the representation of a map (such as its JSON + serialization) easier for human readers to process: for example when + visually inspecting the result of a JSON transformation;

+

To make the result of different implementations interoperable.

+
+

Although it is possible to use the ordering of a map to capture + semantic information, the design of functions such as fn:deep-equal + discourages this: maps are compared with each other, and matched against map types, + without regard to the order of entries.

+
+ + + +
+ Composing and Decomposing Maps @@ -7837,6 +7883,7 @@ return
+ @@ -13156,6 +13203,7 @@ ISBN 0 521 77752 6. or key contains an invalid JSON escape sequence.

+ diff --git a/specifications/xquery-40/src/expressions.xml b/specifications/xquery-40/src/expressions.xml index d6f937aab..231a4e56a 100644 --- a/specifications/xquery-40/src/expressions.xml +++ b/specifications/xquery-40/src/expressions.xml @@ -5408,6 +5408,10 @@ name.

is an instance of K and every value is an instance of V.

+

The entry-order + of a map has no effect on whether the map matches a particular + map type.

+

Although the grammar for TypedMapType @@ -5608,6 +5612,13 @@ name.

type is marked as extensible, then other entries may be present in the map with either string or non-string keys. Entries whose key is a string can be expressed using an (unquoted) NCName if the key conforms to NCName syntax, or using a (quoted) string literal otherwise.

+ +

Although constructors for named record types produce a map in which the + entry order reflects + the order of field definitions in the record type definition, + the entry order + of a map has no effect on whether the map matches a particular + record type: the entries in a map do not have to be in any particular order.

Lookup expressions have been extended in 4.0 so that non-NCName keys can be used without @@ -16923,7 +16934,7 @@ let $z := g($x, $y)]]>

When a ForEntryBinding is used (that is, when either or both of the keywords key and value are used), the key range variable (if present) is bound in turn to each key in the map - (in order), and the value + (in entry order), and the value range variable (if present) is bound to the corresponding value.

In this case the corresponding ExprSingle must evaluate to a single map, otherwise a type error is raised Maps - + + + Ordered maps are introduced. + +

A map is a function @@ -19219,6 +19234,19 @@ processing with JSON processing.

associated with a given key is called the associated value of the key.

+ +

Maps and their properties are defined in the data model: + see . For an overview + of the functions available for processing maps, + see .

+ + +

Maps in &language; are ordered. + The effect of this property is explained + in . + In an ordered map, the order of entries is predictable + and depends on the order in which they were added to the map.

+
Map Constructors @@ -19229,6 +19257,8 @@ 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 + pairs in the map constructor is now retained in the constructed map.

A map can be created using a MapConstructor.

@@ -19345,6 +19375,13 @@ processing with JSON processing.

+ +

The + of the entries in the constructed map retains the order of the + MapConstructorEntry entries + in the input.

+ + Constructing a fixed map @@ -19425,9 +19462,11 @@ processing with JSON processing.

map:of-pairs(//employee ! {'key':@id, 'value':.})

-

All three functions also provide control over how duplicate keys are handled, - allowing them to be used to create a map in which items are grouped according - to the value of a grouping key.

+

All three functions also provide control over:

+ +

The way in which duplicate keys are handled, and

+

The ordering of entries in the resulting map.

+
@@ -19930,8 +19969,9 @@ processing with JSON processing.

If KS is a wildcard (*), the result is the same as $V?pairs::(map:keys($V)).

-

The order of entries in the result sequence in this case - is implementation-dependent.

+

The order of entries in the result sequence + reflects the entry order + of the map.

-

There are two formats with essentially the same semantics.

- -

The unbraced expression if (C) then T else E is equivalent to - the braced expression if (C) { T } else { E }.

-

The ternary expression C ?? T !! E is equivalent to the - braced expression if (C) { T } else { E }.

-

The ternary operator syntax is borrowed from Perl6.

-
-

The value V of a conditional expression using the - braced format is obtained by applying the following rules in order, finishing - as soon as V has a value:

+

The braced expression if (C) then {T} is equivalent to the + unbraced expression if (C) then T else ().

+ +

The value V of a conditional expression in the form if (C) then T + else E is obtained as follows:

+ + -

Let C be the effective boolean value of the test expression, as defined in

Let B be the effective boolean value of the test expression + C, as defined in .

-

If C is true, V is the - value of the EnclosedExpr in the ThenAction.

-
-

The ElseIfActions (if any) are processed in order as follows:

- -

Let C' be the effective boolean value of the test expression, as defined in .

-

If C' is true, V is the - value of the EnclosedExpr in the ElseIfAction - -

-
-
+

If B is true, V is the + result of evaluating T.

- -

If there is an ElseAction, then V - is the value of its EnclosedExpr.

+

Otherwise, V is the + result of evaluating E.

- -

V is the empty sequence.

-
-
- -
+ + + -
+ + -

Whichever format is used, the first step in processing a conditional expression is to find -the effective boolean value of the test expression, as defined in .

- -

The value of a conditional expression is defined as follows: If the -effective boolean value of the test expression is true, the value of the then-expression is returned. If the -effective boolean value of the test expression is false, -the value of the else-expression is returned.

Conditional expressions have a special rule for propagating dynamic errors: expressions whose value is not needed for @@ -20803,14 +20818,7 @@ then $part/wholesale else $part/retail]]> - -

The above expression can equivalently be written:

- - +

The following example returns the attribute node @discount provided the value of @price @@ -20820,15 +20828,15 @@ else $part/retail]]>

The following example tests a number of conditions:

- +]]>
@@ -20836,8 +20844,8 @@ else $part/retail]]>

In the unbraced format, both the then and else clauses are mandatory.

-

In the braced format, an else clause is always unambiguously - associated with the immediately containing IfExpr.

+

In the braced format, the expression terminates unambiguously with the closing + brace.

@@ -22119,6 +22127,104 @@ raised + + Pipeline operator + + + + With the pipeline operator ->, the result of an expression + can be bound to the context value before evaluating another expression. + + + + + + + + +

+ The pipeline operator -> evaluates an expression and + binds the result to the context value before evaluating another expression.

+ +

Each operation E1 -> E2 is evaluated as follows: + Expression E1 is evaluated to a sequence S. + S then serves in turn to provide an inner + (with the context value set to S) for an evaluation of E2 in the + dynamic context. + Unlike the , the result of E1 is bound + just once and as a whole to the context value. +

+ +

The following examples illustrate the use of pipeline operators:

+ + + +

Tokenizes a string, counts the tokens, creates a concatenated string and returns + count=3:

+ 'a b c' -> tokenize(.) -> count(.) -> concat('count=', .) + +

An equivalent expression is: + +let $string := 'a b c' +let $tokens := tokenize($string) +let $count := count($tokens) +return concat('count=', $count) + +

+
+ +

Calculates the sum of powers of 2 and returns + 2046.

+ (1 to 10) ! math:pow(2, .) -> sum(.) +

An equivalent expression is: + +let $powers := ( + for $exp in 1 to 10 + return math:pow(2, $exp) +) +return sum($powers) + +

+
+ +

Doubles the values of a sequence, compares the values pairwise with another + sequence, checks if some comparisons were successful, and returns + true.

+ +(1 to 4) +-> for-each(., op('+')) +-> for-each-pair(4 to 7, ., op('>')) +-> some(.) + +

An equivalent expression is: + +let $data := 1 to 4 +let $data := for-each($data, op('+')) +let $data := for-each-pair(4 to 7, $data, op('>')) +return some($data) + +

+
+ +

Reduces a long sequence to at most 9 elements, with dots appended, + and returns a single string.

+ +$dictionary/word +-> (if(count(.) < 10) then . else (.[1 to 9], '…')) +-> string-join(., '; ') + +

An equivalent expression is: + +let $words := $dictionary/word +let $chopped := (if(count($words) < 10) then $words else ($words[1 to 9], '…')) +return string-join($chopped, '; ') + +

+
+
+
+
+ Simple map operator (!) diff --git a/specifications/xquery-40/src/query-prolog.xml b/specifications/xquery-40/src/query-prolog.xml index d1f69d230..fd607f0dc 100644 --- a/specifications/xquery-40/src/query-prolog.xml +++ b/specifications/xquery-40/src/query-prolog.xml @@ -2129,16 +2129,18 @@ local:depth(doc("partlist.xml"))

implicitly defines the function:

declare function cx:complex($r as xs:double, $i as xs:double := 0) as cx:complex { - map:merge(( - { "r": $r }, - { "i": $i } - )) + map:merge(( { "r": $r }, { "i": $i } )) };

So the call cx:complex(3, 2) produces the value { "r": 3e0, "i": 2e0 }, while the call cx:complex(3) produces the value { "r": 3e0, "i": 0e0 }

+

The order of entries in the map corresponds + to the order of field declarations in the record type. This means, for example, that when + the map is serialized using the JSON output method, the order of entries in the output will + correspond to the order of field declarations.

+

If a field is declared as optional, by including a question mark after the name, and if it has no initializer, then the initializer := () is added implicitly. If the declared type of an optional field does not permit an empty sequence, then the declared type of the function parameter is adjusted by changing the @@ -2157,7 +2159,7 @@ local:depth(doc("partlist.xml")) map:merge(( { "r": $r }, if (exists($i)) { { "i": $i } } - )) + ), { "retain-order" : true() }) }; @@ -2192,7 +2194,10 @@ local:depth(doc("partlist.xml"))

The effect of the duplicates option here is that when two values are supplied for the same field, one as a direct argument in the function call and the other in the options map, the value supplied - as a direct argument is used in preference.

+ as a direct argument is used in preference. The resulting + map has an in which the named fields appear first, in order of + declaration, followed by the extension entries supplied in $options, retaining the + of the $options map.

If the name options is already in use for one of the fields, then the first available name from the sequence ("options1", "options2", ...) is used instead for the additional function parameter.

@@ -2242,8 +2247,7 @@ local:depth(doc("partlist.xml"))

The optional final subexpression, if present, takes the form $options, where $options is the name allocated to the final parameter.

The second argument in the call of the function map:merge - is the map { "duplicates": "use-first" }. This can be omitted if the record is not - extensible, because in this case duplicate field names cannot arise.

+ is the map { "duplicates": "use-first" }.

@@ -2273,6 +2277,13 @@ local:depth(doc("partlist.xml")) + +

Although the constructor function for a named record type produces a map in which the + order of entries corresponds to the order of field declarations in the record type, the order + of entries in a map is immaterial when testing whether a map matches the record type: the entries + can be in any order.

+
+ Using Functions as Entries in Records diff --git a/specifications/xquery-40/src/xquery-header.xml b/specifications/xquery-40/src/xquery-header.xml index 6110fadd2..8f3e01f36 100644 --- a/specifications/xquery-40/src/xquery-header.xml +++ b/specifications/xquery-40/src/xquery-header.xml @@ -104,7 +104,20 @@

This is a draft prepared by the QT4CG (officially registered in W3C as the XSLT Extensions Community Group). Comments are invited.

-
+ + +

The publications of this community group are dedicated to our co-chair, +Michael Sperberg-McQueen (1954–2024).

+

Michael was central to the development of XML and many related technologies. +He brought a polymathic breadth of knowledge and experience to everything he +did. This, combined with his indefatigable curiosity and appetite for learning, +made him an invaluable contributor to our project, along with many others. We +have lost a brilliant thinker, a patient teacher, and a loyal friend.

+

The publications of this community group +are dedicated to our co-chair, +Michael Sperberg-McQueen (1954–2024).

+
+

diff --git a/specifications/xslt-40/schema/xsltspec.dtd b/specifications/xslt-40/schema/xsltspec.dtd index 1e998804c..8331067fe 100644 --- a/specifications/xslt-40/schema/xsltspec.dtd +++ b/specifications/xslt-40/schema/xsltspec.dtd @@ -10,11 +10,9 @@ at CDATA #IMPLIED'> - + diff --git a/specifications/xslt-40/src/element-catalog.xml b/specifications/xslt-40/src/element-catalog.xml index fdaa0f0ed..519bcbb4a 100644 --- a/specifications/xslt-40/src/element-catalog.xml +++ b/specifications/xslt-40/src/element-catalog.xml @@ -1665,6 +1665,11 @@ + diff --git a/specifications/xslt-40/src/schema-for-xslt40.rnc b/specifications/xslt-40/src/schema-for-xslt40.rnc index b86e02ce9..8bbc2fa60 100644 --- a/specifications/xslt-40/src/schema-for-xslt40.rnc +++ b/specifications/xslt-40/src/schema-for-xslt40.rnc @@ -1127,6 +1127,9 @@ map.element = global.atts, sequence-constructor.model } +# TODO: add @on-duplicates +# TODO: add @ordering + map-entry.element = element map-entry { extension.atts, diff --git a/specifications/xslt-40/src/schema-for-xslt40.xsd b/specifications/xslt-40/src/schema-for-xslt40.xsd index 9c2836504..8b3e7d457 100644 --- a/specifications/xslt-40/src/schema-for-xslt40.xsd +++ b/specifications/xslt-40/src/schema-for-xslt40.xsd @@ -1132,7 +1132,9 @@ 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 6dae9151f..d545fef5e 100644 --- a/specifications/xslt-40/src/xslt.xml +++ b/specifications/xslt-40/src/xslt.xml @@ -3,7 +3,7 @@ +-->

XSL Transformations (XSLT) @@ -126,6 +126,11 @@ Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

--> + +

The publications of this community group +are dedicated to our co-chair, +Michael Sperberg-McQueen (1954–2024).

+

This specification defines the syntax and semantics of XSLT 4.0, a language designed @@ -7619,7 +7624,7 @@ and version="1.0" otherwise.

Then the import tree has the following structure:

- + + --> + + + +

+ A +

+ + +

+ B +

+ + +

+ D +

+
+
+
+ +

+ C +

+ + +

+ E +

+
+
+
+
+
+

The order of import precedence (lowest first) is D, B, E, C, A.

@@ -35560,8 +35595,11 @@ 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. + + +

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

@@ -35583,19 +35621,29 @@ the same group, and the-->

In the absense of duplicate keys, the result of the instruction is then given by the XPath 3.1 expression:

map:merge($maps) + +

Informally: in the absence of duplicate keys the resulting map contains the union of the map entries from the supplied sequence of maps.

+ + +

The order of entries in the returned map will reflect + the order of items in the sequence that results from evaluation of the + input sequence.

+
+

The handling of duplicate keys is described in below.

-

There is no requirement that the maps in the input sequence should have the same or - compatible types. The type of a map (for example map(xs:integer, +

There is no requirement that the supplied input maps 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.

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 80429956c..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 @@ -3451,13 +3454,14 @@ the string value of the key the serialized JSON value of the entry, separated by delimiters according to the JSON object syntax, i.e. {key:value, key:value, ...}. -The order in which each key/value pair appears -in the serialized output is -implementation-dependent.

-When map items are serialized using the JSON +The key/value pairs in the serialized output retain the + entry order of entries in the map.

+ + +

If any two keys of the map item have the same string value, serialization error is raised, @@ -3726,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. @@ -3851,9 +3861,14 @@ to output parentheses around a singleton if this avoids buffering data in memory A map item is serialized using the syntax of a without the optional map keyword, that is in the format {key:value, key:value, ...}. -The order of entries is implementation-dependent. The key is serialized by applying the rules +The key/value pairs in the serialized output retain the + entry order of entries in the map. + The key is serialized by applying the rules for serializing an atomic item. The values are serialized in the same way as the members of an array (see above). -

+

+ + +

A function item is serialized to the representation name#A where diff --git a/style/xmlspec-2016.xsl b/style/xmlspec-2016.xsl index 2791bdd01..be0f9a79f 100644 --- a/style/xmlspec-2016.xsl +++ b/style/xmlspec-2016.xsl @@ -1329,6 +1329,15 @@ + + +

+ +

Dedication

+ +
+ +