如何在XML模式中以秒为单位设置持续时间限制

问题描述 投票:0回答:1

元素lenght的最大值为102.5,不能为0。我将元素定义如下:

<xs:element name="lenght">
    <xs:simpleType>
        <xs:restriction base="xs:duration">
            <xs:minInclusive value ="PT0M1S"/>
            <xs:maxExclusive value="PT0M40.5S"/>
        </xs:restriction>
    </xs:simpleType>
 </xs:element>

XML文件给我错误:

元素'lenght'的值'98 .5s'无效。

有什么建议吗?谢谢。

xml xsd duration
1个回答
0
投票
通过W3schools.com,当您使用xs:duration类型时,应遵循xml文件中的xs:duration输入规则。
© www.soinside.com 2019 - 2024. All rights reserved.