diff --git a/specifications/xpath-functions-40/src/function-catalog.xml b/specifications/xpath-functions-40/src/function-catalog.xml index 2cca162db..0dc45ba10 100644 --- a/specifications/xpath-functions-40/src/function-catalog.xml +++ b/specifications/xpath-functions-40/src/function-catalog.xml @@ -13565,14 +13565,21 @@ return contains-sequence(

If the two sequences are both empty, the function returns true.

If the two sequences are of different lengths, the function returns false.

-

If the two sequences are of the same length, the function returns true if +

If the two sequences are of the same length, the comparison is controlled by the + unordered option:

+ +

If the option is false, the function returns true if and only if every item in the sequence $input1 is deep-equal to the - item at the same position in the sequence $input2. The rules for + item at the same position in the sequence $input2. +

+

Otherwise, the function returns true if for every item in + $input1 there is a deep-equal item in $input2 that + has not been matched to another item.

+
+

The rules for deciding whether two items are deep-equal appear below.

- - -

The entries that may appear in the $options map are as follows. The detailed rules - for the interpretation of each option appear later.

+

The entries that may appear in the $options map are as follows. The detailed rules + for the interpretation of each option appear later.

@@ -13668,6 +13675,13 @@ return contains-sequence( xs:boolean true + + Controls whether the top-level order of the items of the input sequences + is considered. + + xs:boolean + false + A list of QNames of elements considered to be unordered: that is, their child elements may appear in any order. @@ -14144,27 +14158,51 @@ declare function equal-strings( - deep-equal(map{1:'a', 2:'b'}, map{2:'b', 1:'a'}) + deep-equal([1, 2, 3], [1, 2, 3]) true() - deep-equal([1, 2, 3], [1, 2, 3]) + deep-equal((1, 2, 3), [1, 2, 3]) + false() + + + + + deep-equal( + map { 1: 'a', 2: 'b' }, + map { 2: 'b', 1: 'a' } +) true() - deep-equal((1, 2, 3), [1, 2, 3]) + deep-equal( + (1, 2, 3, 4), + (1, 4, 3, 2), + map { 'unordered': true() } +) + true() + + + + + deep-equal( + (1, 1, 2, 3), + (1, 2, 3, 3), + map { 'unordered': true() } +) false() "), - parse-xml(""))]]> + parse-xml(""), + parse-xml("") +)]]> true() By default, namespace prefixes are ignored @@ -14172,9 +14210,10 @@ declare function equal-strings( "), - parse-xml(""), - options := map{'namespace-prefixes':true()})]]> + parse-xml(""), + parse-xml(""), + options := map { 'namespace-prefixes': true() } +)]]> false() False because the namespace prefixes differ @@ -14182,9 +14221,10 @@ declare function equal-strings( "), - parse-xml(""), - options := map{'in-scope-namespaces':true()})]]> + parse-xml(""), + parse-xml(""), + options := map { 'in-scope-namespaces': true() } +)]]> false() False because the in-scope namespace bindings differ @@ -14192,8 +14232,9 @@ declare function equal-strings( "), - parse-xml(""))]]> + parse-xml(""), + parse-xml("") +)]]> false() By default, order of elements is significant @@ -14201,9 +14242,10 @@ declare function equal-strings( "), - parse-xml(""), - options := map{'unordered-elements': parse-QName('a')})]]> + parse-xml(""), + parse-xml(""), + options := map {'unordered-elements': xs:QName('a') } +)]]> true() The unordered-elements option means that the ordering of the children of a is ignored. @@ -14212,10 +14254,9 @@ declare function equal-strings( x"), - parse-xml( - " x"))]]> + parse-xml("x"), + parse-xml(" x") +)]]> false() By default, both the leading whitespace in the style attribute and the whitespace text node preceding the span element are significant. @@ -14224,11 +14265,10 @@ declare function equal-strings( x"), - parse-xml( - " x"), - options := map{'whitespace': 'normalize'})]]> + parse-xml("x"), + parse-xml(" x"), + options := map { 'whitespace': 'normalize' } +)]]> false() The whitespace option causes both the leading space in the attribute value and the whitespace preceding the