RE: mixing orderer and unordered elements

In this type of situation I have found it is better to introduce a 
wrapper element to make it absolutely clear and avoid the complex 
structure. An extra element is cheap compared to having errors, and 
it is usually much easier to process with XSL, for example. It also 
makes it easier to compare the files and find changes (which is our 
business!).

It is a real shame that XML Schema has no way to indicate whether 
order is important or not. Choice does not tell you that.

Robin

At 9:52 am -0400 12/6/02, Mark Feblowitz wrote:
>Ah - I wondered about that. Then you'd have to go with something more like
>
><xs:element name="Root">
>		<xs:complexType>
>			<xs:sequence>
>				<xs:element name="Seq1"/>
>				<xs:element name="Seq2"/>
>				<xs:choice>
>					<xs:sequence>
>						<xs:element
>name="Unordered1" minOccurs="0" maxOccurs="unbounded"/>
>						<xs:element
>name="Unordered2" minOccurs="0" maxOccurs="unbounded"/>
>					</xs:sequence>
>					<xs:sequence>
>						<xs:element
>name="Unordered2" minOccurs="0" maxOccurs="unbounded"/>
>						<xs:element
>name="Unordered1" minOccurs="0" maxOccurs="unbounded"/>
>					</xs:sequence>
>				</xs:choice>
>			</xs:sequence>
>		</xs:complexType>
>	</xs:element>
>
>Any number of Unordered1's followed by any number of Unordered2's, or
>Any number of Unordered2's followed by any number of Unordered1's
>
>Does that sound more like it?
>
>Mark Feblowitz                                  
>XML Architect
>        [t]   617.715.7231                                    
>        [f]   617.495.0188
>Frictionless Commerce Incorporated
>        [e]  mfeblowitz@frictionless.com
>        [w] http://www.frictionless.com
>        [m] 400 Technology Square, 9th Floor
>              Cambridge, MA 02139
>Open Applications Group Incorporated
>        [e]  mfeblowitz@openapplications.org
>        [w] http://www.openapplications.org
>
>  -----Original Message-----
>From:	Torsten Curdt [mailto:tcurdt@dff.st]
>Sent:	Wednesday, June 12, 2002 3:58 AM
>To:	Mark Feblowitz; xmlschema-dev@w3.org
>Subject:	Re: mixing orderer and unordered elements
>
>Hi, Mark,
>
>thanks for the suggestion but
>
>On Tuesday 11 June 2002 17:14, Mark Feblowitz wrote:
>>  How about:
>>
>>	<xs:element name="Root">
>>		<xs:complexType>
>>			<xs:sequence>
>>				<xs:element name="Seq1"/>
>>				<xs:element name="Seq2"/>
>>				<xs:sequence>
>>					<xs:choice maxOccurs="unbounded">
>>						<xs:element
>>  name="Unordered1"/>
>>						<xs:element
>>  name="Unordered2"/>
>>					</xs:choice>
>>				</xs:sequence>
>>			</xs:sequence>
>>		</xs:complexType>
>>	</xs:element>
>
>wouldn't that also allow:
>
>   <Root>
>      <Seq1/>
>      <Seq2/>
>      <Unordered2/>
>      <Unordered1/>
>      <Unordered2/>
>   </Root>
>
>which is not what I want...
>--
>Torsten


-- 
-- -----------------------------------------------------------------
Robin La Fontaine, Director, Monsell EDM Ltd
DeltaXML: "Change control for XML in XML"
Tel: +44 1684 592 144 Fax: +44 1684 594 504
Email: robin.lafontaine@deltaxml.com      http://www.deltaxml.com

Received on Wednesday, 12 June 2002 10:22:48 UTC