Re: [xml-dev] <xs:all> with different elements in any order

From
George Cristian Bina <>
To
Mukul Gandhi <>
Date
2007-09-19T12:57:25Z
ID
<>
Thread
Re: [xml-dev] <xs:all> with different elements in any order
Hi Mukul,

You can write that as

(a+, b, (a|b)*) | (b+, a, (a|b)*)

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Mukul Gandhi wrote:
> Hi all,
>    I want to validate an XML instance like following with W3C XML Schema.
> 
> <OBJECTS>
>   <!-- A & Bs in any order and unbounded. B can be before A also. -->
>   <A>ddjhfj</A>
>   <B>hghgh</B>
>   <!-- more A & Bs -->
> </OBJECTS>
> 
> I want a Schema like (which is invalid) following.
> 
> <xs:element name="OBJECTS">
>    <xs:complexType>
>        <xs:all>
>           <xs:element name="A" type="xs:string" maxOccurs="unbounded" />
>           <xs:element name="B" type="xs:string" maxOccurs="unbounded" />
>        </xs:all>
>     </xs:complexType>
> </xs:element>
> 
> But this is wrong, because in this Schema maxOccurs can be 0 or 1.
> 
> Could somebody please suggest a Schema for this requirement.
>