【发布时间】:2016-11-01 12:33:18
【问题描述】:
您能帮我理解 XML Schema 文档的这个错误吗?我试图以这种方式区分同一元素的两种类型(如果元素“policy”的属性“type”等于“Reachability”,则元素的类型将为“Rpolicy”,否则为“Tpolicy” ) :
<xsd:element name="policy" type="xsd:anyType" minOccurs="0" maxOccurs="unbounded">
<xsd:alternative type="Rpolicy" test="@type = 'Reachability' "/>
<xsd:alternative type="Tpolicy"/>
</xsd:element>
我正在使用 Eclipse Neon 4.6.1,我收到此错误:
s4s-elt-must-match.1: 'policy' 的内容必须匹配 (annotation?, (simpleType | complexType)?, (unique | key | keyref)*))。发现一个问题开始于:替代。 def.xsd /RemoteSystemsTempFiles/xsd 第 8 行 XML 架构问题
第8行是
<xsd:alternative type="Rpolicy" test="@type = 'Reachability' "/>
你能帮我理解错误吗?
【问题讨论】: