W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2005

[Bug 2111] R-122: Issue re: restricting substitution groups

From: <bugzilla@wiggum.w3.org>
Date: Fri, 09 Sep 2005 15:12:09 +0000
To: www-xml-schema-comments@w3.org
Cc:
Message-Id: <E1EDkXx-0006xM-Hg@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2111

           Summary: R-122: Issue re: restricting substitution groups
           Product: XML Schema
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSD Part 1: Structures
        AssignedTo: ht@w3.org
        ReportedBy: sandygao@ca.ibm.com
         QAContact: www-xml-schema-comments@w3.org


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
Received on Friday, 9 September 2005 15:12:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:09 GMT