Re: Rationale for restricted uses of "all"

Hi Dave,

> The schema specification states that extension is always required to
> *append* derived content to the base type, with a brief statement
> that this makes it easier to test conformance of any specializations
> against the base type definition.
>
> If you interpret this such that the derived type is validated as the
> <all> group from the base type, followed by the <all> group from the
> derived type, then your example should be valid.

As you state, when you extend a type (and neither the original type
nor the extensions are empty), the content type of the new type is a
sequence of the particle from the base type followed by the particle
from the derived type. So you get a sequence of two all groups.

But consider the all groups in the sequence. I think that they need to
meet "Schema Component Constraint: All Group Limited" from
http://www.w3.org/TR/xmlschema-1/#coss-modelGroup, which states:

  When a model group has {compositor} all all of the following must be true:
  1 one of the following must be true:
  1.1 It appears as the model group of a model group definition.
  1.2 It appears in a particle with {min occurs}={max occurs}=1, and
  that particle must be part of a pair which constitutes the {content
  type} of a complex type definition.
  2 The {max occurs} of all the particles in the {particles} of the
  group must be 0 or 1.

I don't think they meet 1.1 (because they're not in model group
definition) and they aren't the content type of a complex type
definition, because they're part of a sequence.

Therefore I think it's *not* valid to extend an all with an all.

(I had to think for a while about why XML Schema allows you to have an
extension that contains an all group, but of course it's because the
base type could be empty [just attributes].)

I think we could do with some clarification.

Cheers,

Jeni

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

Received on Friday, 9 November 2001 06:11:31 UTC