Reputation: 83
When I try
<xsd:simpleType>
<xsd:restriction base="xsd:nonNegativeInteger">
<xsd:maxLength value="35"/>
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
I get the error
The
maxLength
facet is not applicable to types derived fromxs:integer
How can I achieve a positive integer with minLength
and maxLength
?
Upvotes: 1
Views: 2013
Reputation: 111621
To allow integers between 1..35, inclusive:
<xsd:simpleType>
<xsd:restriction base="xsd:nonNegativeInteger">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="35"/>
</xsd:restriction>
</xsd:simpleType>
To allow integers with 1..35 digits:
<xsd:simpleType>
<xsd:restriction base="xsd:nonNegativeInteger">
<xsd:pattern value="\d{1,35}"/>
</xsd:restriction>
</xsd:simpleType>
Upvotes: 1