This section describes what are built-in datatypes defined in XSD 1.1 specification. There are total of 49 built-in datatypes. And 19 of them are primitive datattypes.
Before moving on to more complex XSD schema definitions,
we need to have a better understanding of how many built-in datatypes are supported,
what are they, and how they are related to each other.
To know many built-in datatypes in XSD 1.1, we can look at this
diagram included in the XSD 1.1 specification:
Here is what I learned from this diagram:
There is 1 special entry in the diagram called "all complex types" which represents all user defined custom datatypes.
All other 50 entries in the diagram represent 50 built-in datatypes which are predefined in XSD 1.1.
There are 3 special built-in datatypes: anyType, anySimpleType and anyAtomicType, that are acting like base datatypes
for major built-in datatype groups.
Other 47 non-special built-in datatypes are divided 3 groups:
19 Primitive (or Primitive Atomic Built-in) datatypes,
25 Other built-in atomic (or Derived Atomic Built-in) datatypes
and 3 Built-in list (or List Built-in) datatypes.
By reading more details in XSD 1.1 specification, I have the following understanding
of how built-in datatypes are grouped:
Primitive Datatypes -
A primitive datatype has a value set with only original values, which are not shared with other
primitive datatypes.
For example, "decimal" and "string" are primitive datatypes.
"decimal" values represent numerical values.
"string" values represent character sequences.
They do not share any values.
Derived Datatypes -
A derived datatype has a value set derived from another datatype, called the base datatype.
The value set of a derived datatype is a subset of the value set of the base datatype.
For example, "integer" is a derived datatype, derived from the base datatype, "decimal".
"integer" value set is a subset of "decimal" value set.
In other words, all valid "integer" values are valid "decimal" values.
Atomic Datatypes -
An atomic datatype is a datatype whose values are individual values,
not constructed from other values.
For example, "NMTOKEN" is an atomic datatype, because its values are individual values.
Each "NMTOKEN" value can not be treated as a structure of other datatype values.
List Datatypes -
A list datatype is a datatype whose values are lists of other datatype values.
For example, "NMTOKENS" is a list datatype, because its values are lists of "NMTOKEN" values.