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
<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