The use these elements:
minInclusive - a minimum where the boundary value can be used.
maxInclusive - a maximum where the boundary value can be used.
minExclusive - a minimum where the boundary value can not be used.
minExclusive - a minimum where the boundary value can not be used.
The maximum must always be bigger than the minimum.
The integers between 2 and 5:
<xs:simpleType name="score"> <xs:restriction base="xs:integer"> <xs:minInclusive value="2"/> <xs:maxInclusive value="5"/> </xs:restriction> </xs:simpleType>