[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 19:39:32 -0000
Message-ID: <002501c76cb9$d9ccdda0$c900a8c0@Codalogic>
To: "Nataraj Ramalingam" <Nataraj.Ramalingam@aricent.com>
Cc: <xmlschema-dev@w3.org>
Re: Attributes ordering

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


> Does the same hold good, if wildcard is used?
>
> In the same mentioned example, instead of b, let's assume that a wildcard
> appears.
> =========================================================================
> <xs:complexType name="test">
>        <xs:sequence>
>                <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:sequence>
> </xs:complexType>
>
> <xs:element name="test" type="test"/>
> ====================================================================================
> In this case, can there be instances of following possibilities,
> a,b,c
> a,c,b
> b,a,c
> a,c, b, b       where b is an element of some other namespace.

Actually none of these are permitted!  The reason is that the xs:any 
wildcard says that the wildcard has to be in another namespace.

But the requirement for the order of the sequence still remains.

So let's say we have other elements other:b1 and other:b2.  Then we could 
have

a, c
a, other:b1, c
a, other:b2, other:b1, c
etc.

But NOT:
a, c, other:b1

Sadly, as yet, you can not just change the namespace definition in the 
xs:any to namespace="##any" due to schema's unique particle attribution 
constraint.  This is not easy to explain, so try googling:

http://www.google.co.uk/search?hl=en&q=unique+particle+attribution

> 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?

If you know examples where this is shown I'd be interested to hear.

Cheers,

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 19:41:33 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.