∟Facets, Constraining Facets and Restriction Datatypes
This chapter provides notes and tutorial examples on datatype facets, constraining facets and restriction datatypes. Topics include introduction of fundamental facets and constraining facets; constructing new user-defined datatypes by reducing constraining facets on a base datatypes; facets descriptions of 'string', 'dateTime' and 'decimal' built-in datatypes.
A facet on a datatype refers to a property of the datatype.
Every simple datatype has 4 fundamental facets: ordered, bounded, cardinality, numeric.
Every simple datatype has zero or more constraining facets: whiteSpace, length, minLength,
maxLength, pattern, enumeration, maxInclusive, maxExclusive, minExclusive, minInclusive,
totalDigits, fractionDigits, Assertions, explicitTimezone.
Constraining facets on a datatype can be modified to be more restrictive.
A new user-defined datatype can be constructed by modifying constraining facets of an existing datatype.
"string" and its derived datatypes have 7 constraining facets: whiteSpace, length, minLength, maxLength,
pattern, enumeration, assertions.
"dateTime" and its related datatypes have 9 constraining facets:
explicitTimezone, whiteSpace, pattern, enumeration, assertions, maxInclusive, maxExclusive, minInclusive, minExclusive.
"decimal" and its derived datatypes have 10 constraining facets:
whiteSpace, pattern, enumeration, assertions, maxInclusive, maxExclusive, minInclusive, minExclusive, totalDigits, fractionDigits.