Name
xs:simpleType(local definition) — Local simple type definition (local definitions cannot be referenced).
Synopsis
<xs:simpleType id = xs:ID {any attributes with non-schema namespace} > Content: (xs:annotation?, (xs:restriction | xs:list | xs:union)) </xs:simpleType>
May be included in: xs:attribute (reference or local definition), xs:attribute (global definition), xs:element (within xs:all), xs:element (reference or local definition), xs:element (global definition), xs:list, xs:restriction (simple type), xs:restriction (simple content), xs:union
Description
Local simple datatypes are defined directly where needed (during element, attribute, or other simple type definitions) for local anonymous usage, and cannot be referenced as such in other places of a schema.
Like global simple datatypes, these are defined by derivation from
other simple datatypes (either predefined by W3C XML Schema or other
user-defined datatypes) using one of the three derivation methods
available for simple types: xs:restriction
to add
new constraints to a datatype, xs:list
to define
lists of values, and xs:union
to perform the union
of the lexical spaces of several datatypes).
Restrictions
W3C XML Schema doesn’t provide any mechanism for creating new primary datatypes, new facets, or to act on the transformation performed between the lexical and value spaces (for instance, it is not possible to change the representation of the decimal point).
Example
<xs:simpleType name="myInteger"> <xs:restriction> <xs:simpleType> ...
Get XML Schema now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.