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 UTC