Simple type
The XML Schema language contains many built-in simple types. Using these types as a foundation, the language allows you to derive your own custom simple types.
Custom simple types combine features from existing datatypes and provide more control over the specification of content of elements in the schema
They can be defined with sets of restrictions and specific patterns that define acceptable content
Custom simple types are defined globally and can be reused throughout the schema
The generic form is
<xsd:simpleType name=”nameType”>
- <xsd:restriction base=”xsd:string”>
<xsd:pattern value=”values” />
</xsd:restriction>
</xsd:simpleType>
The name that is referenced in the opening declaration is the name of the simpleType and not the element in which it will be used
An example is
<xsd:simpleType name=”statusType”>
- <xsd:restriction base=”xsd:string”>
<xsd:pattern value=”freshman | sophomore | junior | senior” />
</xsd:restriction>
</xsd:simpleType>