Can you help me understand this error with a XML Schema document please? I'm trying to differentiate two types of the same element in this way (if the attribute "type" of the element "policy" is equal to "Reachability", the type of the element will be "Rpolicy", "Tpolicy" otherwise) :
<xsd:element name="policy" type="xsd:anyType" minOccurs="0" maxOccurs="unbounded">
<xsd:alternative type="Rpolicy" test="@type = 'Reachability' "/>
<xsd:alternative type="Tpolicy"/>
</xsd:element>
I'm using Eclipse Neon 4.6.1 and I get this error :
s4s-elt-must-match.1: The content of 'policy' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: alternative. def.xsd /RemoteSystemsTempFiles/xsd line 8 XML Schema Problem
Line 8 is
<xsd:alternative type="Rpolicy" test="@type = 'Reachability' "/>
Can you help me understanding the error?