W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

Restricting substitution groups?

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Thu, 06 Dec 2001 17:38:51 +0100
Message-ID: <3C0F9F1B.70208@dyomedea.com>
To: xmlschema-dev@w3.org
Given that a substitution group is kind of equivalent to xs:choice:


2.1 Any top-level element declaration particle (in R or B) which is the 
{substitution group affiliation} of one or more other element 
declarations is treated as if it were a choice group whose {min occurs} 
and {max occurs} are those of the particle, and whose {particles} 
consists of one particle with {min occurs} and {max occurs} of 1 for the 
top-level element declaration and for each of the declarations in its 
·substitution group·.

Does that mean that we can restrict substitution groups?

If for instance I have:

<xs:element name="head"/>
<xs:element name="a" substitutionGroup="head"/>
<xs:element name="b" substitutionGroup="head"/>
<xs:element name="c" substitutionGroup="head"/>


<xs:complexType name="base">
    <xs:element ref="head"/>


<xs:complexType name="derived">
   <xs:restriction base="base">
        <xs:element ref="a"/>
        <xs:element ref="b"/>

a valid restriction?

I guess not since it doesn't seem to match the condition for restricting 

Schema Component Constraint: Particle Derivation OK (Choice:Choice -- 
For a choice group particle to be a ·valid restriction· of another 
choice group particle all of the following must be true:
1 R's occurrence range is a valid restriction of B's occurrence range as 
defined by Occurrence Range OK (§3.9.6);
2 There is a complete ·order-preserving· functional mapping from the 
particles in the {particles} of R to the particles in the {particles} of 
B such that each particle in the {particles} of R is a ·valid 
restriction· of the particle in the {particles} of B it maps to as 
defined by Particle Valid (Restriction) (§3.9.6).
NOTE: Although the ·validation· semantics of a choice group does not 
depend on the order of its particles, derived choice groups are required 
to match the order of their base in order to simplify checking that the 
derivation is OK.

The question should then probably be which is the order of the elements 
of a substitution group when they are mapped to a xs:choice during 
validation (and how can this be used to restrict a substitution group) ?


See you in Orlando for XML 2001.
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
Received on Thursday, 6 December 2001 11:38:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:56 UTC