W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2007

Re: Attributes ordering

From: Nataraj Ramalingam <Nataraj.Ramalingam@aricent.com>
Date: Fri, 23 Mar 2007 00:18:41 +0530
To: "Pete Cordell" <petexmldev@tech-know-ware.com>
Cc: xmlschema-dev@w3.org
Message-ID: <OF8F06F085.5EDDC612-ON652572A6.00658AA5-652572A6.006755C8@flextronicssoftware.com>
Does the same hold good, if wildcard is used? 

In the same mentioned example, instead of b, let's assume that a wildcard 
<xs:complexType name="test">
                <xs:element name="a" type="xs:string"/>
                    <xs:any namespace="##other" processContents="lax" 
minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="c" type="xs:string"/>

<xs:element name="test" type="test"/>
In this case, can there be instances of following possibilities,
a,c, b, b       where b is an element of some other namespace.

I see that in some of the IETF protocols, only whenever wildcard is used, 
the order of elements inside a sequence seems strange. It simply allows 
any possibilities, almost breaking the expected sequence behavior. 
COuld this be clarified?

Kind Regards,

"Pete Cordell" <petexmldev@tech-know-ware.com> 
Sent by: xmlschema-dev-request@w3.org
03/22/2007 11:27 PM

Nataraj Ramalingam/CHE/HSS@HSS
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 
> )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.


Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit



***********************  Aricent-Private   ***********************
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of 
the individual to whom it is addressed. It may contain privileged or confidential information and should not be 
circulated or used for any purpose other than for what it is intended. If you have received this message in error, 
please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly
prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for 
loss or damage arising from the use of the information transmitted by this email including damage from virus."
Received on Thursday, 22 March 2007 18:48:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:41 UTC