From 27a34ddb08b9c945b7b0f2b02dc9d6cd1176b0f0 Mon Sep 17 00:00:00 2001
From: Michael Kay 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 union(A, B)
and also
-for union(A, C)
). In XDM, item types include node types,
+(A
is substitutable for the union type (A | B)
and also
+for the union type (A | C)
). In XDM, item types include node types,
function types, and built-in atomic types. The list, which shows only
hierarchic relationships, is therefore a simplification of the full
model.
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 union(A, B)
and also
-for union(A, C)
. In XDM, item types include node 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
only hierarchic relationships, is therefore a simplification of the
full model.
@@ -6491,8 +6491,8 @@ correctly in all browsers, depending on the system configuration.-->
fn:parse-html
function.
get
is a function providing ready access to a given
field in a given row. The function has signature:
The function takes two arguments: the first is an integer giving the row number (1-based), the second identifies a column either by its name or by its 1-based position.
The type of the third argument of fn:format-number
has
- changed from xs:string
to union(xs:string, xs:QName)
.
+ changed from xs:string
to (xs:string | xs:QName)
.
Because the expected type of this parameter is no longer xs:string
, the
special coercion rules for xs:string
parameters no longer apply.
For example, it is no
diff --git a/specifications/xquery-40/src/expressions.xml b/specifications/xquery-40/src/expressions.xml
index 7356457cb..a02606cb9 100644
--- a/specifications/xquery-40/src/expressions.xml
+++ b/specifications/xquery-40/src/expressions.xml
@@ -6212,17 +6212,17 @@ name.
union(xs:short, xs:long) ⊆ xs:integer
+ (xs:short | xs:long) ⊆ xs:integer
because xs:short ⊆ xs:integer
and xs:long ⊆ xs:integer
.union(P, Q) ⊆ union(P, Q, R)
- because P ⊆ union(P, Q, R)
and Q ⊆ union(P, Q, R)
.(P | Q) ⊆ (P | Q | R)
+ because P ⊆ (P | Q | R)
and Q ⊆ (P | Q | R)
.enum("red", "green") ⊆ xs:string
because the
enumeration type enum("red") ⊆ xs:string
and enum("green") ⊆ xs:string
.enum("red", "green") ⊆ enum("red", "green", "blue")
because
enum("red") ⊆ enum("red", "green", "blue")
and
enum("green") ⊆ enum("red", "green", "blue")
.enum("red", "green", "blue") ⊆ union(enum("red", "green"), enum("blue"))
because
+ enum("red", "green", "blue") ⊆ (enum("red", "green") | enum("blue"))
because
each of the types enum("red")
, enum("green")
, and enum("blue")
is a subtype of one of the two members of the union type.
Where an item type contains a reference to a named item type that is non-recursive, the reference
is expanded, recursively, as the first step in evaluating the subtype relationship. For example
this means that if U is a named item type with the expansion
- union(xs:integer, xs:double)
,
+ (xs:integer | xs:double)
,
then xs:integer ⊆ U
is true, because
- xs:integer ⊆ union(xs:integer, xs:double)
is true.
xs:integer ⊆ (xs:integer | xs:double)
is true.
Recursive types are considered to be, in the terminology of the computer science
literature, The semantics of the path operator can also be defined using the simple map operator ( The semantics of the path operator can also be defined using the simple
+ map operator (!
) as follows (forming the union with an empty sequence ($R union ())
has the effect of eliminating duplicates and sorting nodes into document order):!
) as follows (the function
+ fn:distinct-ordered-nodes($R)
has the effect of
+ eliminating duplicates and sorting nodes into document order):xs:string
whose enumeration facet restricts the value space to the single string "red"
,
while cast $x as enum("red", "green")
is equivalent to casting
- to union(enum("red"), enum("green"))
.
(enum("red") | enum("green"))
.
If my:chrono
is a named item type that expands to
- union(xs:date, xs:time, xs:dateTime)
, then the result
+ (xs:date | xs:time | xs:dateTime)
, then the result
of my:chrono("12:00:00Z")
is the xs:time
value 12:00:00Z
.