XQuery
Priscilla Walmsley (pwalmsley@datypic.com)
ISBN: 0596006349
1st edition, , O'Reilly Media, Inc.
Chapter 11: A closer look at types
Example | Effective Boolean value |
---|---|
()
|
false
|
false()
|
false
|
true()
|
true
|
""
|
false
|
"false"
|
true
|
"x"
|
true
|
0
|
false
|
xs:float("NaN")
|
false
|
(false() or false())
|
false
|
doc("prices.xml")/*
|
true
|
<a>false</a>
|
true
|
(false(), false(), false())
| Error |
1, 2, 3
| Error |
xs:date("2007-01-15")
| Error |
Example | Explanation |
---|---|
node()*
| A sequence of one or more nodes, or the empty sequence |
item()?
| One item (a node or an atomic value) or the empty sequence |
xs:anyAtomicType+
| A sequence of one or more atomic values (of any type) |
Example | Explanation |
---|---|
xs:integer
| One atomic value of type xs:integer (or any type derived by restriction from xs:integer ) |
xs:integer?
| One atomic value of type xs:integer (or any type derived by restriction from xs:integer ), or the empty sequence |
prod:NameType*
| A sequence of one or more atomic values of type prod:NameType , or the empty sequence |
Example | Explanation |
---|---|
3 instance of xs:integer
|
true
|
3 instance of xs:decimal
| true , because xs:integer is derived by restriction from xs:decimal |
<x>{3}</x> instance of xs:integer
| false , because the element node x is untyped, even though it happens to contain an integer |
<x>{3}</x> instance of element()
|
true
|
<x>{3}</x> instance of node()
|
true
|
<x>{3}</x> instance of item()
|
true
|
(3, 4, 5) instance of xs:integer
|
false
|
(3, 4, 5) instance of xs:integer*
|
true
|
xs:float(3) instance of xs:double
|
false
|
Expression | Value |
---|---|
xs:string("012")
|
"012"
|
xs:string(012)
|
"12"
|
xs:string(xs:float(12.3E2))
|
"1230"
|
xs:untypedAtomic(xs:float(12))
| 12 (of type xs:untypedAtomic ) |
xs:string(true())
|
"true"
|