Re: min/maxOccurs in group ref

Hi Kihup,

> In the following, minOccurs > maxOccurs.
> ...
> <xsd:group ref="MyGroup" minOccurs="5" maxOccurs="2"/>
> ...
>
> Is this supposed to be invalid?
> Or, is validation done only on the instance documents?

This is invalid in the schema according to 2.1 of the following:

  Schema Component Constraint: Particle Correct

  All of the following must be true:
  1 The values of the properties of a particle must be as described
    in the property tableau in The Particle Schema Component (§3.9.1),
    modulo the impact of Missing Sub-components (§5.3).
  2 If {max occurs} is not unbounded, that is, it has a numeric
    value, then all of the following must be true:
    2.1 {min occurs} must not be greater than {max occurs}.
    2.2 {max occurs} must be greater than or equal to 1.

               From: http://www.w3.org/TR/xmlschema-1/#p-props-correct

So a validator should complain when it sees this in the schema.
               
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Wednesday, 31 October 2001 12:55:45 UTC