[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Attributes ordering

From: Pete Cordell <petexmldev@tech-know-ware.com>
Date: Thu, 22 Mar 2007 17:57:45 -0000
Message-ID: <002401c76cab$9c9a8c10$c900a8c0@Codalogic>
To: "Nataraj Ramalingam" <Nataraj.Ramalingam@aricent.com>
Cc: <xmlschema-dev@w3.org>
Re: Attributes ordering

Original Message From: "Nataraj Ramalingam" <Nataraj.Ramalingam@...>

>. I have one more doubt w.r.t ordering of elements.
> consider the following example.
> =====================================================
> <xs:complexType name="test">
>        <xs:sequence>
>                <xs:element name="a" type="xs:string"/>
>                <xs:element name="b" type="xs:string" minOccurs="0"/>
>                <xs:element name="c" type="xs:string"/>
>        </xs:sequence>
> </xs:complexType>
>
> <xs:element name="test" type="test"/>
> =====================================================
>
> Eventhough we use a sequence type here, does this mandate the order of
> elements in the instance to be only a,b,c.
> Or, since "b" is optional ( minOccurs=0 ), can it (should it, by any means
> )come after "c" in the instance? for example, can the ordering be a,c,b?


As it's a sequence, if b is present, then it must appear between a and c 
(i.e. the same order as specified in the definition).  (so a, b, c or just 
a, c.)

The xs:all construct for the order to be changed, but there are currently 
numerous restrictions on that.

HTH,

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx/
http://www.codalogic.com/lmx/
=============================================
Received on Thursday, 22 March 2007 17:58:07 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.