What are the XQuery built-in types?

I thought that I knew, but when I listed them all out, my answer was
non-intuitive and I realized that there does not exist a complete taxonomy
in the current drafts against which I can check my work.


The XQuery Language draft says
"The built-in types of XQuery include the built-in atomic types of [XML
Schema] (such as xs:integer and xs:string), and the following special
derived types: fn:dayTimeDuration and fn:yearMonthDuration (described in
[XQuery 1.0 and XPath 2.0 Functions and Operators])."
http://www.w3.org/TR/xquery/#id-type-conversion
(15 Nov draft, Section 2.4, paragraph 1)

However, the data model clarifies that
"An atomic type is a primitive simple type or a type derived by restriction
from a primitive simple type. Types derived by list or union are not
atomic."
http://www.w3.org/TR/query-datamodel/#AtomicValue
(15 Nov draft, section 5, paragraph 1)
[and then attempts to confuse the reader with a digression into the nineteen
primitive built-in types of schema]


So it seems from the above definitions that XQuery has all of the built-in
atomic types from XML Schema except those that are derived by list, plus the
extra types that XQuery adds.

By my count, this means XQuery has 44 built-in atomic types:  The 44 types
of XML Schema 1.0, minus the three list types NMTOKENS, IDREFS, ENTITIES,
plus the two duration types dayTimeDuration and yearMonthDuration, plus the
ur-type anySimpleType.  (Magically the three types XQuery adds cancels out
the three types it removes.)

Is this correct?



Thanks,

Michael Brundage
xquery@attbi.com

Received on Saturday, 8 February 2003 23:52:49 UTC