RE: block="substitution" in local element definitions

Simon, forwarding your suggestion to xml-schema comments.

David C. Fallside, IBM
Ext Ph: 530.477.7169
Int  Ph: 544.9665

|         |           Simon.Cox@csiro.a|
|         |           u                |
|         |                            |
|         |           02/19/2002 04:57 |
|         |           PM               |
|         |                            |
  |                                                                                                                     |
  |       To:,, David Fallside/Santa Teresa/IBM@IBMUS              |
  |       cc:                                                                                |
  |       Subject:  RE: block="substitution"  in local element definitions                                              |
  |                                                                                                                     |
  |                                                                                                                     |

Yep - that clarifies the current spec.
All participants in a substitution group must be global.

But I'd like to pursue this a little further.
w3c-xml-schema-ig might be a better forum:

For readers from there, my original mail to
xmlschema-dev was a request for clarification
regarding whether it was necessary for substitution
group members to be global.
The Primer seems to imply no (which led to my initial
confusion), while Structures clearly says yes.

David Fallside - I suggest that the prose in the
primer be adjusted to make it clear that substitution
group /members/ must also be top-level elements.

Now my issue:
I can certainly understand why the SG head must be top-level.
But it is not clear to me why this constraint should be applied to SG
It would seem quite reasonable and quite useful in
to declare membership in a SG locally.
The SG mechanism is a very nice tool for building choice-groups
It is not completely open, since to be a member of a SG it is still
necessary to satisfy type-derivation rules.
So as long as this is satisfied, why not declare a new element (and even
anonymous type) locally to be the member of an SG that is valid in this
Why is it necessary for the SG members to be global elements?

_____  CSIRO Exploration & Mining
26 Dick Perry Avenue, Kensington WA 6151
PO Box 1130, Bentley WA 6102  AUSTRALIA
T: +61 (8) 6436 8639  F: +61 (8) 6436 8555  C: +61 (4) 0330 2672

> -----Original Message-----
> From: Jeni Tennison []
> Sent: Tuesday, 19 February 2002 8:33 PM
> To:
> Cc:;
> Subject: Re: block="substitution" in local element definitions
> Hi Simon,
> > But in Structures it says at [2]
> >
> > "[Definition:] Through the new mechanism of element substitution
> > groups, XML Schemas provides a more powerful model supporting
> > substitution of one named element for another. Any top-level element
> > declaration can serve as the defining element, or head, for an
> > element substitution group. Other *top-level* element declarations,
> > regardless of target namespace, can be designated as members of the
> > substitution group headed by this element. "
> >
> > Is this the normative restriction in the spec? I cannot find any
> > other reference requiring substitutionGroup members or heads to be
> > global/top-level ...
> I think that this is a normative restriction in the spec. Substitution
> groups are actually defined as follows:
>   Schema Component Constraint: Substitution Group
>   [Definition:] Every element declaration in the {element
>   declarations} of a schema defines a substitution group, a subset of
>   those {element declarations}, as follows:
>   1 The element declaration itself is in the group;
>   2 The group is closed with respect to {substitution group
>     affiliation}, that is, if any element declaration in the {element
>     declarations} has a {substitution group affiliation} in the group,
>     then it is also in the group itself.
> What's relevant here is that the substitution group is made up of
> a subset of element declarations from the {element declarations} of
> the schema. The {element declarations} of the schema are defined as:
>   A set of named (top-level) element declarations.
> So substitution groups can only contain global element declarations.
> This is backed up by the fact that the schema for schemas only allows
> substitutionGroup attributes on top-level element declarations, not on
> local element declarations. The head of the substitution group must be
> a global element declaration; otherwise it would be impossible for the
> schema validator to locate it when it's referred to through the
> substitutionGroup attribute.
> I hope that clarifies things for you,
> Jeni
> ---
> Jeni Tennison

Received on Wednesday, 20 February 2002 13:25:14 UTC