Error: The maxLength facet is not applicable to types derived from xs:integer

Error: The maxLength facet is not applicable to types derived from xs:integer

当我尝试时

<xsd:simpleType>
    <xsd:restriction base="xsd:nonNegativeInteger">
        <xsd:maxLength value="35"/>
        <xsd:minLength value="1"/>
    </xsd:restriction>
</xsd:simpleType>

我收到错误

The maxLength facet is not applicable to types derived from xs:integer

如何用 minLengthmaxLength 得到正整数?

允许 1..35 之间的整数,包括:

<xsd:simpleType>
    <xsd:restriction base="xsd:nonNegativeInteger">
        <xsd:minInclusive value="1"/>
        <xsd:maxInclusive value="35"/>
    </xsd:restriction>
</xsd:simpleType>

允许使用 1..35 位的整数:

<xsd:simpleType>
    <xsd:restriction base="xsd:nonNegativeInteger">
        <xsd:pattern value="\d{1,35}"/>
    </xsd:restriction>
</xsd:simpleType>