Ошибка: фасет maxLength не применим к типам, производным от xs: integer - PullRequest
0 голосов
/ 20 сентября 2018

Когда я пытаюсь

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

я получаю ошибку

Фасет maxLength не применим к типам, полученным из xs:integer

Как мне получить положительное целое число с minLength и maxLength?

1 Ответ

0 голосов
/ 20 сентября 2018

Чтобы разрешить целые числа от 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>
...