XSD any element
- by ofer shwartz
HI! I'm trying to create a list that some of the elements are defined and some are not, without priority to order.
I tried it this way, with an any element:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="object" mixed="true">
<xs:choice>
<xs:element name="value" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:enumeration value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:any namespace="##any" processContents="skip"/>
</xs:choice>
</xs:complexType>
<xs:element name="object" type="object"/>
</xs:schema>
And it tells me this error:
:0:0: error: complex type 'object' violates the unique particle attribution rule
in its components 'value' and '##any'
Can someone help me out solve the problem?
Ofer