Pre-defined types
Most pre-defined types are defined in the XSD but the XDM and XPath specifications augment these with additional types, such as:
xs:dateTimeStampxs:errorxs:numeric- items types
For more detailed information about types, see:
-
Schemas and Types in the XDM 4.0 specification
-
Types in the XPath 4.0 specification
-
Atomic Items in the XDM 4.0 specification
-
Atomic Comparisons: An Overview (Non-Normative) in the XPath 4.0 specification
Table of pre-defined types
The table below is an attempt to create an alphabetical list of all the types, how they relate to each other and the categories they are formally or colloquially assigned to in the specification documents.
There are two main categories of pre-defined type: schema types (which are mostly prefixed with xs:) and item types (which are suffixed with a pair of round brackets). In the table below, additional categories are listed. These are classes of type defined in one or more the specifications; see abbreviations brackets.
From XPath 4.0, for the purpose of comparing atomic items, the primitive atomic types are divided into a number of comparison families: atomic items belonging to types in the same family are mutually comparable, items belonging to different type families are not.
| Name | Description | Category | Parent type | Sub-types | Comparison family | Notes |
|---|---|---|---|---|---|---|
|
|
A generalisation, representing any atomic item type. |
|
|
Introduced in XDM 3.0. |
||
|
|
A restriction of xs:anyType to just all atomic values and all finite-length lists of zero or more atomic values. |
|
Introduced in XDM 3.0. |
|||
|
|
A generalisation that represents all datatypes. |
|
||||
|
|
An Internationalized Resource Identifier Reference (IRI). |
|
String-like |
|||
|
|
An array. |
|
Function |
For more information, see Arrays. Sources: [22] |
||
|
|
An XML attribute. |
|
Attribute |
Sources: [22] |
||
|
|
Arbitrary Base64-encoded binary data. |
|
Binary |
|||
|
|
The values |
|
Boolean |
|||
|
|
A generalized atomic type. |
|
Numeric |
|||
|
|
An XML comment. |
|
Comment |
Sources: [22] |
||
|
|
An entire calendar day. |
|
Date |
|||
|
|
An instant in time. |
|
DateTime |
|||
|
|
A generalized atomic type. |
|
DateTime |
|||
|
|
A generalized atomic type. |
|
Duration |
Introduced in XDM 3.0. |
||
|
|
A real number that can be represented by decimal numerals. |
|
Numeric |
|||
|
|
A wrapper node that represents an XML document. |
|
Document |
Sources: [22] |
||
|
|
A double-precision floating point number. |
|
Numeric |
|||
|
|
A duration of time without fixed endpoints. |
|
Duration |
|||
|
|
An XML element. |
|
Element |
Sources: [22] |
||
|
|
|
Sources: [24] |
||||
|
|
A list of |
|
||||
|
|
An XML entity. |
|
String-like |
|||
|
|
A constraint on |
|
N/A |
|||
|
|
A union type. Also a generalized atomic type. |
|
Not expected to have any instances. See Types adopted from XML Schema |
|||
|
|
A floating point number. |
|
Numeric |
|||
|
|
A function. |
|
Function |
For more information, see Function items. From XPath 4.0, function items have an identity property, which can be used to test whether two variables refer to the same function item or not. Sources: [22] |
||
|
|
A whole Gregorian day within an arbitrary month and year. |
|
gDay |
|||
|
|
A whole Gregorian month within an arbitrary year. |
|
gMonth |
|||
|
|
A whole day within a specific Gregorian month in an arbitrary year. |
|
gMonthDay |
|||
|
|
A generalized node. It is always either an |
|
Introduced in XDM 4.0. |
|||
|
|
A whole Gregoria year. |
|
gYear |
|||
|
|
A whole Gregorian month in a specific Gregorian year. |
|
gYearMonth |
|||
|
|
Arbitrary hex-encoded binary data. |
|
Binary |
|||
|
|
An XML identifier. |
|
String-like |
|||
|
|
A cross-reference to an |
|
String-like |
|||
|
|
A list of |
|
||||
|
|
A generalized atomic type. |
|
Numeric |
|||
|
|
A generalized atomic type. |
|
Numeric |
|||
|
|
An item is either an atomic item, a GNode, or a function item. |
|
||||
|
|
An encapsulation of a value as it appears within a tree of maps and arrays, typically (but not necessarily) obtained by parsing JSON texts. |
|
JNode |
Introduced in XDM 4.0. |
||
|
|
A formal natural language identifier. |
|
String-like |
|||
|
|
|
|||||
|
|
A generalized atomic type. |
|
Numeric |
|||
|
|
A map. |
|
Function |
For more information, see Maps. A Sources: [22] |
||
|
|
An XML Name. |
|
String-like |
|||
|
|
An XML namespace node. |
|
Namespace |
Sources: [22] |
||
|
|
An XML "non-colonized" |
|
String-like |
|||
|
|
A generalized atomic type. |
|
Numeric |
|||
|
|
A single name token. |
|
String-like |
|||
|
|
A list of |
|
||||
|
|
An XML node. Also known as: |
|
|
XNode |
While the concept of a node existed before 4.0, the term |
|
|
|
A generalized atomic type. |
|
Numeric |
|||
|
|
A generalized atomic type. |
|
Numeric |
|||
|
|
A string that doesn't contain the following characters: carriage return ( |
|
String-like |
|||
|
|
An XML notation attribute. |
|
Notation |
|||
|
|
A union type whose members are: |
|
||||
|
|
A generalized atomic type. |
|
Numeric |
|||
|
|
A processing instruction (PI). |
|
Processing-instruction |
Sources: [22] |
||
|
|
An XML qualified name. |
|
QName |
|||
|
|
May be used to constrain the type of items that may be added to a map. |
|
Function |
Sources: [22] |
||
|
|
A schema attribute. |
|
Schema Attribute |
While the concept of a |
||
|
|
A schema element. |
|
Schema Element |
While the concept of a |
||
|
|
One or more occurrences of an |
|
Sources: [13] |
|||
|
|
An |
|
||||
|
|
A string of characters. |
|
String-like |
|||
|
|
Text in XML. |
|
Text |
Sources: [22] |
||
|
|
An instant in time that recurs at the same point in each calendar day, or that occurs in some arbitrary calendar day. |
|
Time |
|||
|
|
An xs:normalizedString that has no leading or trailing spaces ( |
|
String-like |
|||
|
|
A generalized type. |
|
N/A |
Sources: [2] |
||
|
|
Derived from |
|
Numeric |
|||
|
|
Derived from |
|
Numeric |
|||
|
|
A generalized atomic type. |
|
Numeric |
|||
|
|
Derived from |
|
Numeric |
|||
|
|
A primitive atomic type. |
|
String-like |
|||
|
|
An alternative name for |
Introduced in XDM 4.0. This alternative name is only used in documentation. It's not expected to be used in code. |
||||
|
|
A generalized atomic type. |
|
Duration |
Introduced in XDM 3.0. |
Sources
- https://www.w3.org/TR/xmlschema11-2/
- https://www.w3.org/TR/xmlschema11-2/#atomic-vs-list
- https://www.w3.org/TR/xmlschema11-2/#built-in-primitive-datatypes
- https://www.w3.org/TR/xmlschema11-2/#dt-atomic
- https://www.w3.org/TR/xmlschema11-2/#dt-list
- https://www.w3.org/TR/xmlschema11-2/#dt-ordinary
- https://www.w3.org/TR/xmlschema11-2/#dt-union
- https://www.w3.org/TR/xmlschema11-2/#ID
- https://www.w3.org/TR/xmlschema11-2/#language
- https://www.w3.org/TR/xmlschema11-2/#special-datatypes
- https://qt4cg.org/specifications/xpath-datamodel-40/Overview.html#xs-types
- https://www.w3.org/TR/xpath-datamodel-31/
- https://www.w3.org/TR/2017/REC-xpath-31-20170321/#id-cast
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#dt-generalized-atomic-type
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#dt-GNode
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#dt-item
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#dt-JNode
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#dt-XNode
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#id-enumeration-types
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#id-item-subtype-attributes
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#id-item-subtype-elements
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#id-matching-item
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#id-namespace-sensitive
- https://qt4cg.org/specifications/xquery-40/xpath-40.html#id-sequencetype-syntax