xsd-不允许在枚举列表中定义值
我想对属性强制执行一条规则,该规则不允许在与另一个属性关联的枚举值中定义值 这是我的示例模式xsd-不允许在枚举列表中定义值,xsd,schema,Xsd,Schema,我想对属性强制执行一条规则,该规则不允许在与另一个属性关联的枚举值中定义值 这是我的示例模式 <xs:complexType name="component"> <xs:attribute name="type" type="componentMainType"/> <xs:attribute name="category" type="forbiddenCategoryTypes" use="optional"/> </xs:compl
<xs:complexType name="component">
<xs:attribute name="type" type="componentMainType"/>
<xs:attribute name="category" type="forbiddenCategoryTypes" use="optional"/>
</xs:complexType>
<xs:simpleType name="forbiddenCategoryTypes">
<xs:restriction base="xs:string">
**<xs:pattern value="not in forbiddenCategoryTypes"/>**
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="componentMainType">
<xs:restriction base="xs:string">
<xs:enumeration value="Component1"/>
<xs:enumeration value="Component2"/>
<xs:enumeration value="Component3"/>
<xs:enumeration value="Component4"/>
<xs:enumeration value="Component5"/>
</xs:restriction>
</xs:simpleType>
****
在我看来不可能,模式只接受正则表达式。我找不到任何其他相关限制
我建议改变使用值的正则表达式的方法(我知道这不是最佳解决方案)