I currently have this in an XSD:
<xs:element name="qty" maxOccurs="1" minOccurs="1" />
How can I add a rule that also only allows the value of Qty
to be between 100 to 2000?
I currently have this in an XSD:
<xs:element name="qty" maxOccurs="1" minOccurs="1" />
How can I add a rule that also only allows the value of Qty
to be between 100 to 2000?
Use xs:restriction
with xs:{min|max}{In|Ex}clusive
:
<xs:simpleType name="Quantity100to2000">
<xs:restriction base="xs:integer">
<xs:minExclusive value="100"/>
<xs:maxExclusive value="2000"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="qty" maxOccurs="1" minOccurs="1" type="Quantity100to2000"/>