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

Re: Interpretation of a choice element

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 19 Apr 2002 09:59:16 +0100
Message-ID: <1031473925112.20020419095916@jenitennison.com>
To: Autumn Cuellar <a.cuellar@auckland.ac.nz>
CC: xmlschema-dev@w3.org
Hi Autumn,

> How should the following be interpreted:
>
>   <xsd:complexType name="A">
>     <xsd:choice>
>       <xsd:element ref="B" minOccurs="0" maxOccurs="1" />
>       <xsd:element ref="C" minOccurs="0" maxOccurs="unbounded" />
>       <xsd:element ref="D" minOccurs="0" maxOccurs="unbounded" />
>     </xsd:choice>
>   </xsd:complexType>
>
> Would it be the same as saying
>
> <!ELEMENT A (B? | C* | D*)>
>
> in a DTD?

Yes. You're saying the content of the element A is one of the
following:

  - empty
  - a single element B
  - any number of element Cs
  - any number of element Ds

An element A cannot contain a mixture of B, C and D elements at the
same time.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Friday, 19 April 2002 04:59:17 GMT

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