3
有没有办法在XSD中定义一个具有空限制的类型别名/ strong typedef/simpleType?XML架构类型别名?
<xsd:simpleType name="identifier">
<xsd:restriction base="xsd:string">
<xsd:pattern value="^[a-zA-Z_][a-zA-Z0-9_]*$" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="type">
<xsd:restriction base="identifier" />
</xsd:simpleType>
我想以后应用上类型的属性一些验证逻辑“类型”比一个类型的属性的更多具体的“识别符”。
补充说明,在XSD使用的正则表达式中,模式在两端隐式锚定,所以^和$是多余的。 –