homepage Welcome to WebmasterWorld Guest from 54.227.77.237
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
XML Schema: Arbitrary Positioning
I Know This Can be Done, but How?
cmarshall




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

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?

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved