我使用以下定义运行
XML Schema:
<xs:simpleType name="ClassRankType"> <xs:restriction base="xs:integer"> <xs:totalDigits value="4"/> <xs:minInclusive value="1"/> <xs:maxInclusive value="9999"/> </xs:restriction> </xs:simpleType>@H_301_3@但是,在我看来,totalDigits是多余的.我对XML Schema有些新意,并希望确保我没有错过任何东西. @H_301_3@totalDigits与maxInclusive的实际行为是什么? @H_301_3@totalDigits总是可以用minInclusive和MaxInclusive的组合来表示吗? @H_301_3@totalDigits如何影响负数?
@H_301_3@can totalDigits always be represented with a combination of minInclusive and MaxInclusive?@H_301_3@在这种情况下,是的.当您处理整数时,该值必须是整数,因此您在minInclusive和maxInclusive之间有一组有限的值.如果您有十进制值,则totalDigits会告诉您该值可能有多少个数字.
@H_301_3@How does totalDigits affect negative numbers?@H_301_3@它是数字中允许的总位数,不受小数点,减号等的影响.从auxy.com开始:
@H_301_3@The number specified by the value attribute of the <xsd:totalDigits>
facet will restrict the total number of digits that are allowed in the number,on both sides of the decimal point.