XSD any element

Posted by ofer shwartz on Stack Overflow See other posts from Stack Overflow or by ofer shwartz
Published on 2010-04-07T10:54:13Z Indexed on 2010/04/07 12:23 UTC
Read the original article Hit count: 332

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about xsd

Related posts about any