schema unordered element list with any element

Discussion in 'XML' started by CJ, Dec 17, 2003.

  1. CJ

    CJ Guest

    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
     
    CJ, Dec 17, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ibiza
    Replies:
    5
    Views:
    1,237
    S. Justin Gengo [MCP]
    Feb 9, 2006
  2. Naresh Agarwal
    Replies:
    1
    Views:
    1,321
    Martin Honnen
    Mar 7, 2004
  3. Kevin Campbell
    Replies:
    3
    Views:
    1,071
    Kevin Campbell
    Apr 26, 2004
  4. Replies:
    3
    Views:
    426
    Joseph Kesselman
    Oct 17, 2007
  5. Nico Grubert
    Replies:
    0
    Views:
    312
    Nico Grubert
    Jun 30, 2010
Loading...

Share This Page