W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2002

Choice

From: Andrew Wilson <andreww@naa.gov.au>
Date: Fri, 22 Feb 2002 12:04:16 +1100
Message-ID: <2BC4D1CA28C5D511AA190002A574CADB238186@SPARMAIL3>
To: "'XMLDev'" <xmlschema-dev@w3.org>
Hi

I'm new to XML schema development so my question might be really simple and
have been answered years ago:)

In the XML Schema Spec. part 1 it says in sect. 3.8.1: "...(choice)
correspond to exactly one of the specified particles;". I read this as
saying one of the particles in the choice group *must* appear.

However, the XML representation summary in 3.8.2 allows a minOccurs for
choice of 0 (nonNegativeInteger). So is the following valid?:

<xsd:choice minOccurs="0" maxOccurs="unbounded">
 <xsd:element ref="A"/>
 <xsd:element ref="B"/>
 <xsd:element ref="C"/>
 <xsd:element ref="D"/>
 <xsd:element ref="E"/>
 <xsd:element ref="F"/>
 <xsd:element ref="G"/>
</xsd:choice>

[I'm trying to say that none of the elements have to be used but any of them
can be used as many times as needed]

If this is correct, how should the statement in 3.8.1 be read?
Thanks.

Andrew Wilson
Received on Thursday, 21 February 2002 20:05:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT