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

xsd:group, minOccurs and xsd:choice

From: Nick Brook <nick.brook@3glab.com>
Date: Wed, 5 Feb 2003 14:50:24 -0000
Message-ID: <02b601c2cd25$ea1cb870$a700000a@tse>
To: <xmlschema-dev@w3.org>


I'm trying to create a group with a choice of a number of elements. I want
the behaviour that at least one of the choice must exist, but can't find a
way in Schema to enforce this.
Here's a fragment of my schema:

  <xs:group name="actions">
      <xs:element name="noaction">
      <xs:element name="writevar">
  <xs:element name="change">
        ...some other elements...
        <xs:element name="do" minOccurs="1" maxOccurs="1">
          <xs:complexType mixed="false">
            <xs:group ref="actions" minOccurs="1" maxOccurs="unbounded"/>

This allows the following:

Bizarrely it also allows:

I want the parser to flag both these examples as erroneous.

Any help would be much appreciated,


Nick Brook
Received on Wednesday, 5 February 2003 09:48:45 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:59 UTC