Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何定义具有以下限制的 XSd Integer 数据类型:第一个数字不应为零。(开头没有零)
您可以使用<xs:restriction>基于xs:integer数据类型的元素以及<xs:pattern>这样的方面:
<xs:restriction>
xs:integer
<xs:pattern>
<xs:restriction base="xs:integer"> <xs:pattern value="[^0].*"/> </xs:restriction>
这将只允许允许的值xs:integer是有效的,附加限制是第一个字符不能是零。
请注意,<xs:pattern>元素中的模式始终引用整个值,因此^不需要像这样的开始标记。
^