W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2001

Re: <group> element's attributes

From: Eddie Robertsson <eddie@allette.com.au>
Date: Tue, 08 May 2001 00:32:46 +1000
Message-ID: <3AF6B20D.B4CC705C@allette.com.au>
To: KAZUMI Saito <ksaito@jp.fujitsu.com>
CC: xmlschema-dev@w3.org
>About the new Recommendation, XML Representation of Model Group ( in 3.7.2)
>does not have minOccurs, maxOccurs, ref attributes.
>
><group
>  name = NCName>
>  Content: (annotation?, (all | choice | sequence))
></group>
>
>but, the correspondence between the properties and these attributes
>are explained. These attributes are really removed ?

If you continue reading in the same paragraph [1] you find the following:

"The name of this section is slightly misleading, in that the second, un-named,
case above (with a ref and no name) is not really a named model group at all,
but a reference to one. Also note that in the first (named) case above no
reference is made to minOccurs or maxOccurs: this is because the schema for
schemas does not allow them on the child of <group> when it is named. This in
turn is because the {min occurs} and {max occurs} of the particles which refer
to the definition are what count."

So, this means that if you declare a named group (using the name attribute) you
cannot use the attributes ref, minOccurs or maxOccurs on the xsd:group element
itself. This is logical since the same rules apply for global element and
attribute declarations (no occurence restrictions are allowed on global
declarations).
However, if you reference a group within a content model (using the ref
attribute) you are free to use minOccurs and maxOccurs as you see fit.

One thing I find a bit strange is that the above sentence [1] also restrict the
use of minOccurs and maxOccurs on the children of xsd:group. If I understand
this correctly the following is invalid:

<xsd:group>
      <xsd:sequence maxOccurs="2">
      ...
      </xsd:sequence>
</xsd:group>

Is there a specific reason why this is not allowed?

Cheers,
/Eddie

[1] http://www.w3.org/TR/xmlschema-1/#declare-namedModelGroup
Received on Sunday, 6 May 2001 22:35:31 GMT

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