This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2111 - R-122: Issue re: restricting substitution groups
Summary: R-122: Issue re: restricting substitution groups
Status: NEW
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.0 only
Hardware: All Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: needsDrafting
Depends on:
Blocks:
 
Reported: 2005-09-09 15:12 UTC by Sandy Gao
Modified: 2012-12-04 00:53 UTC (History)
0 users

See Also:


Attachments

Description Sandy Gao 2005-09-09 15:12:09 UTC
Can substitution groups be restricted? 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"/>

 and:

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

 is

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

 a valid restriction?
Since substitution groups are treated as choices for particle restriction 
checking, the case that applies here is RecurseLax. However, the rules for 
RecurseLax state:

"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?

See: http://lists.w3.org/Archives/Public/xmlschema-dev/2001Dec/0080.html
Comment 1 Sandy Gao 2005-09-09 15:12:50 UTC
Martin Gudgin:
http://lists.w3.org/Archives/Public/xmlschema-dev/2002Feb/0037.html 

Henry Thompson:

Yes. The REC is underspecified in the area of the order of the implicit choice 
represented by a substitution group head. I think an erratum is in order, as 
Martin Gudgin suggested, clarifying that in this case the order constraint 
doesn't apply.

See:
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2002JanMar/0512.html

Resolution:
Resolved at the May f2f. Editor is instructed to draft a minimalist erratum 
that fixes the problem.