Enumeration limits a value space to a specific set of values - if a value isn't specified in the set in the schema, it isn't valid. : enumeration « XML Schema « XML Tutorial






<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.java2s.com" xmlns="http://www.java2s.com"
  elementFormDefault="qualified">

  <xs:simpleType name="Sizes">
    <xs:restriction base="xs:string">
      <xs:enumeration value="S" />
      <xs:enumeration value="M" />
      <xs:enumeration value="L" />
      <xs:enumeration value="XL" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>








3.66.enumeration
3.66.1.Specifying a Set of Acceptable Values
3.66.2.enumeration Constrains the value of the data type to a defined set of values
3.66.3.Enumeration limits a value space to a specific set of values - if a value isn't specified in the set in the schema, it isn't valid.
3.66.4.Enumerating A Simple Type