Welcome to WebmasterWorld Guest from 54.196.175.173

Forum Moderators: httpwebwitch

Message Too Old, No Replies

XML Schema: Arbitrary Positioning

I Know This Can be Done, but How?

     

cmarshall

8:06 pm on Aug 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I want to have a schema that validates green when I have the proper enclosed elements in any order.

To wit:

The schema:

<xs:element name="container">
<xs:complexType>
<xs:sequence maxOccurs="1" minOccurs="1">
<xs:element name="element_a" type="xs:string" maxOccurs="1" minOccurs="1" nillable="true"/>
<xs:element name="element_b" type="xs:string" maxOccurs="1" minOccurs="1" nillable="true"/>
<xs:element name="element_c" type="xs:string" maxOccurs="1" minOccurs="1" nillable="true"/>
</sequence>
</complexType>
</element>

Says this is OK:

<container>
<element_a/>
<element_b/>
<element_c/>
</container>

But I also want this to be OK:

<container>
<element_b/>
<element_c/>
<element_a/>
</container>

Currently, my experience with schema says that I cannot arbitrarily place <element_c/> before <element_a/>. I can make them optional, but they need to be placed in order.

I know this can be done, I'm just not sure how.

Can someone give a ticket to the cluetrain?

 

Featured Threads

Hot Threads This Week

Hot Threads This Month