Re: How ensure group elements exist and in any order

On 10/6/2004 11:54 AM, Michael Kay wrote:
>>But the all group would allow also none of the elements.
> 
> 
> Not if the element specifies minOccurs="1".
> 

but in that case an all group wouldn't allow only a or only b.  I 
thought that was a requirement.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <xsd:element name="root">
         <xsd:complexType>
             <xsd:choice>
                 <xsd:sequence>
                     <xsd:element ref="a"/>
                     <xsd:element ref="b" minOccurs="0"/>
                 </xsd:sequence>
                 <xsd:sequence>
                     <xsd:element ref="b"/>
                     <xsd:element ref="a" minOccurs="0"/>
                 </xsd:sequence>
             </xsd:choice>
         </xsd:complexType>
     </xsd:element>
     <xsd:element name="a" type="xsd:string"/>
     <xsd:element name="b" type="xsd:string"/>
</xsd:schema>

-- 
Anli Shundi					ashundi@tibco.com
TIBCO Software Inc.				office: (919) 969-6518
www.tibco.com


Get Firefox! http://www.mozilla.org/products/firefox/

Received on Wednesday, 6 October 2004 17:24:55 UTC