W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2002

RE: block="substitution" in local element definitions

From: David Fallside <fallside@us.ibm.com>
Date: Wed, 20 Feb 2002 10:11:46 -0800
To: Simon.Cox@csiro.au
Cc: www-xml-schema-comments@w3.org
Message-ID: <OF032DB9CF.5D76937F-ON88256B66.0063D8B1@boulder.ibm.com>

Simon, forwarding your suggestion to xml-schema comments.

............................................
David C. Fallside, IBM
Ext Ph: 530.477.7169
Int  Ph: 544.9665
fallside@us.ibm.com



|---------+---------------------------->
|         |           Simon.Cox@csiro.a|
|         |           u                |
|         |                            |
|         |           02/19/2002 04:57 |
|         |           PM               |
|         |                            |
|---------+---------------------------->
  >---------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                     |
  |       To:       jeni@jenitennison.com, w3c-xml-schema-ig@w3.org, David Fallside/Santa Teresa/IBM@IBMUS              |
  |       cc:       xmlschema-dev@w3.org                                                                                |
  |       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
members.
It would seem quite reasonable and quite useful in
derivation-by-restriction
to declare membership in a SG locally.
The SG mechanism is a very nice tool for building choice-groups
progressively.
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
its
anonymous type) locally to be the member of an SG that is valid in this
context?
Why is it necessary for the SG members to be global elements?

_____
Simon.Cox@csiro.au  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
http://www.csiro.au/page.asp?type=resume&id=CoxSimon

> -----Original Message-----
> From: Jeni Tennison [mailto:jeni@jenitennison.com]
> Sent: Tuesday, 19 February 2002 8:33 PM
> To: Simon.Cox@csiro.au
> Cc: vdv@dyomedea.com; xmlschema-dev@w3.org
> 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.
>                      http://www.w3.org/TR/xmlschema-1/#cos-equiv-class
>
> 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.
>                 http://www.w3.org/TR/xmlschema-1/#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
> http://www.jenitennison.com/
>
Received on Wednesday, 20 February 2002 13:25:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:33 UTC