dot*_*dot 4 xml xsd xsd-validation
我寻找一种方法来检查我的 xsd,某个标签仅包含不同允许的字符串之一。
例如,两个允许的字符串是:
好的:
<TYPE>Index</TYPE>
<TYPE>Condition</TYPE>
Run Code Online (Sandbox Code Playgroud)
错误的:
<TYPE>Integer</TYPE>
Run Code Online (Sandbox Code Playgroud)
我的xsd中的type定义如下:
<xs:element name="TYPE">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Run Code Online (Sandbox Code Playgroud)
<xs:element name="TYPE">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:enumeration value="Index"/>
<xs:enumeration value="Condition"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2709 次 |
| 最近记录: |