The following table lists primitive XML schema data types, facets that can be applied to the data type, and a description of the data type.
Facets can only appear once in a type definition except for enumeration and pattern facets. Enumeration and pattern facets can have multiple entries and are grouped together.
Data Type | Facets | Description |
---|---|---|
string | length, pattern, maxLength, minLength, enumeration, whiteSpace | Represents character strings. |
Boolean | pattern, whiteSpace | Represents Boolean values, which are either true or false. |
decimal | enumeration, pattern, totalDigits, fractionDigits, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents arbitrary precision numbers. |
float | pattern, enumeration, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents single-precision 32-bit floating-point numbers. |
double | pattern, enumeration, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents double-precision 64-bit floating-point numbers. |
duration | enumeration, pattern, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents a duration of time.
The pattern for duration is |
dateTime | enumeration, pattern, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents a specific instance of time.
The pattern for dateTime is This representation may be immediately followed by a "Z" to indicate Coordinated Universal Time (UTC) or to indicate the time zone. For example, the difference between the local time and Coordinated Universal Time, immediately followed by a sign, + or -, followed by the difference from UTC represented as |
time | enumeration, pattern, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents an instance of time that recurs every day.
The pattern for time is |
date | enumeration, pattern, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents a calendar date.
The pattern for date is |
gYearMonth | enumeration, pattern, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents a specific Gregorian month in a specific Gregorian year. A set of one-month long, nonperiodic instances.
The pattern for gYearMonth is |
gYear | enumeration, pattern, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents a Gregorian year. A set of one-year long, nonperiodic instances.
The pattern for gYear is |
gMonthDay | enumeration, pattern, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents a specific Gregorian date that recurs, specifically a day of the year such as the third of May. A gMonthDay is the set of calendar dates. Specifically, it is a set of one-day long, annually periodic instances.
The pattern for gMonthDay is |
gDay | enumeration, pattern, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents a Gregorian day that recurs, specifically a day of the month such as the fifth day of the month. A gDay is the space of a set of calendar dates. Specifically, it is a set of one-day long, monthly periodic instances.
The pattern for gDay is |
gMonth | enumeration, pattern, minInclusive, minExclusive, maxInclusive, maxExclusive, whiteSpace | Represents a Gregorian month that recurs every year. A gMonth is the space of a set of calendar months. Specifically, it is a set of one-month long, yearly periodic instances.
The pattern for gMonth is |
hexBinary | length, pattern, maxLength, minLength, enumeration, whiteSpace | Represents arbitrary hex-encoded binary data. A hexBinary is the set of finite-length sequences of binary octets. Each binary octet is encoded as a character tuple, consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. |
base64Binary | length, pattern, maxLength, minLength, enumeration, whiteSpace | Represents Base64-encoded arbitrary binary data. A base64Binary is the set of finite-length sequences of binary octets. |
anyURI | length, pattern, maxLength, minLength, enumeration, whiteSpace | Represents a URI as defined by RFC 2396. An anyURI value can be absolute or relative, and may have an optional fragment identifier. |
QName | length, enumeration, pattern, maxLength, minLength, whiteSpace | Represents a qualified name. A qualified name is composed of a prefix and a local name separated by a colon. Both the prefix and local names must be an NCName. The prefix must be associated with a namespace URI reference, using a namespace declaration. |
NOTATION | length, enumeration, pattern, maxLength, minLength, whiteSpace | Represents a NOTATION attribute type. A set of QNames. |
XML Schema Element Map | XML Data Types Reference | Derived XML Data Types | Data Type Facets