[Bug 5296] An oddity with substitution groups

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

           Summary: An oddity with substitution groups
           Product: XML Schema
           Version: 1.1 only
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Structures: XSD Part 1
        AssignedTo: cmsmcq@w3.org
        ReportedBy: mike@saxonica.com
         QAContact: www-xml-schema-comments@w3.org


Consider a base type:

    <xs:complexType name="b">
       <xs:sequence>     
         <xs:element ref="a"/>
       </xs:sequence>
    </xs:complexType>

and a supposedly derived type

     <xs:complexType name="r">
      <xs:complexContent>
        <xs:restriction base="b">
          <xs:sequence>
            <xs:element name="A"/> <!--NB name, not ref-->
          </xs:sequence>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType> 

with the element declarations

<xs:element name="a"/>
<xs:element name="A" substitutionGroup="a"/>

Is r validly derived from b? As far as I can see, it satisfies "Content type
restricts", despite the fact that the local element declaration A is not a
member of the substitution group of "a" (local element declarations never
belong to a substitution group). 

Is this intended?

Received on Thursday, 29 November 2007 13:52:47 UTC