【发布时间】:2010-08-13 12:30:46
【问题描述】:
我有一个 xml 架构
<xs:complexType>
...
<xs:attribute ref="unaryOperator"></xs:attribute>
</xs:complexType>
<xs:attribute name="unaryOperator">
我尝试在我的 xml 文件中使用它 像这样
<inv_constraint unaryOperator="not">
编辑器给我这个错误:
描述资源路径位置类型 [Xerces] cvc-complex-type.3.2.2:属性“unaryOperator”不允许出现在元素“inv_constraint”中。 @see:http://www.w3.org/TR/xmlschema-1/#cvc-complex-typeabc.xml /prova 第 28 行 XML 问题
编辑建议我这样做
<inv_constraint xmlns:ns1="http://abc/abcd" ns1:unaryOperator="not" >
如果我不使用 xml 架构中的 ref 并且只是复制粘贴属性而不是引用它,那么我的 xml 文件可以工作,
所以我的问题是如何在没有那个奇怪标签的情况下使我的 xml 有效并将 ref 保留在 xml 架构中?
【问题讨论】: