Re: <group> element's attributes

>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 UTC