schema unordered element list with any element

CJ

Usenet Archive
Joined
Mar 3, 2000
Messages
203
Reaction score
0
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
548,049
Messages
3,104,245
Members
248,133
Latest member
DujonT

Latest Threads

Top