schema unordered element list with any element

C

CJ

I started with this schema:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="response">
<xs:complexType>
<xs:sequence>
<xs:element name="SysTime" type="xs:string"/>
<xs:element name="Item">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" type="xs:long"/>
<xs:element name="Time"
type="xs:string"/>
<xs:any minOccurs="0"
maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:any minOccurs="0" maxOccurs="unbounded"
processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

The need has risen to have the elements in any order.

I tried various combinations to no avail, including using xs:choice like
this:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="response">
<xs:complexType>
<xs:choice minOccurs="0">
<xs:element name="SysTime" type="xs:string"/>
<xs:element name="Item">
<xs:complexType>
<xs:choice minOccurs="0">
<xs:element name="Id" type="xs:long"/>
<xs:element name="Time"
type="xs:string"/>
<xs:any minOccurs="0"
maxOccurs="unbounded" processContents="skip"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:any minOccurs="0" maxOccurs="unbounded"
processContents="skip"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

Can someone help me out?

the intent for this schema is to be fed into jaxb xml processor but it
throws errors on the xs:choice version (even though xml-spy says it is
fine)

TIA,
CJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top