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>
      <xs:restriction base="xs:integer">
        <xs:maxExclusive value="5"/>
      </xs:restriction>
    </xs:simpleType>
    <xs:minInclusive value="-2"/>
  </xs:restriction>
</xs:simpleType>

Attributes

id

W3C XML Schema’s element ID.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.244.216