我对在另一个XSD中重新定义一个XSD的简单类型有疑问。
sample1.xsd:
<xs:simpleType name="tLineType">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="mainLine" />
<xs:enumeration value="secondaryLine" />
<xs:enumeration value="branchLine" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="tOtherEnumerationValue" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:simpleType name="tOtherEnumerationValue">
<xs:restriction base="xs:string">
<xs:pattern value="other:\w{2,}" />
</xs:restriction>
</xs:simpleType>sample2.xsd:
我需要向tLineType(ex:test_Track,Depot)添加更多的枚举值。
如何实现上述功能?
提前谢谢你。
发布于 2017-10-30 07:42:30
在xs:redefine中,您只能通过使模式更具限制性来重新定义它,而您则试图使它更加自由(通过添加以前不允许的允许值)。
您已经将其标记为XSD1.1。在XSD1.1中,有一种新的机制xs:重写,它允许对基本模式中的组件进行任意更改。
https://stackoverflow.com/questions/47009093
复制相似问题