XML Schema defines 19 primitive datatypes, and five others (
xs:yearMonthDuration) were added to the XML
Schema namespace by the XQuery 1.0 and XPath 2.0 Data Model spec. We’ll
review those briefly here.
XPath 1.0 used the
datatype as its basic data structure; XPath 2.0 uses sequences. Like a
sequence can contain the node types we covered
earlier in this appendix, but it can also contain atomic values of the
types listed here.
Here are the 24 datatypes:
The base type for all primitive atomic types, such
xs:string. This datatype was added by
XQuery 1.0 and XPath 2.0.
A Uniform Resource Identifier. The value can be absolute or relative, and it can also have a fragment reference identifier. The value should follow the rules for URI syntax as defined in RFC 2396 and amended in RFC 2732.
Arbitrary binary data represented using the Base64
alphabet defined in RFC 2045. Legal characters are the basic alpha
characters and digits
[a-zA-Z0-9], along with the plus sign
+), the forward slash
/), and the equals sign
xs:base64Binary value can also contain
any number of whitespace characters.
false. In XSLT and XPath, the
"false" have no special meaning. To
generate boolean values, use the functions
A date with four components: year, month, ...