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

[Bug 2174] R-176: Question about mixed in derivation by extension

From: <bugzilla@wiggum.w3.org>
Date: Wed, 14 Sep 2005 18:13:16 +0000
To: www-xml-schema-comments@w3.org
Message-Id: <E1EFbky-00071H-Oc@wiggum.w3.org>


           Summary: R-176: Question about mixed in derivation by extension
           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

Consider the following schema fragment: 

   <xs:complexType name="mixed" mixed="true">
     <xs:choice minOccurs="0" maxOccurs="unbounded">
       <xs:element ref="test:a"/>
       <xs:element ref="test:b"/>
   <xs:element name="root">
         <xs:extension base="test:mixed">
           <xs:attribute name="id" type="xs:ID"/>

Is the following instance valid? (i.e. is root allowed to have mixed content?)

 <root xmlns="http://example.com/test">

Henry's response: Yes. Note, however, that this "redundancy" can only be 
avoided when the extending definition is empty -- if any substantive element 
content is added, then the result is specified by the REC to take its 'mixed' 
from the extending definition. But the REC also rules out extending mixed with 
element-only or vice-versa, so there's no point. 

This isn't a big deal, but it should probably be fixed, by
- specifiying that in complexContent extension, the mixed _always_ comes from 
the base; 
- ruling out conflicting 'mixed' on <complexType> or <complexContent> when 
deriving by extension. 

Received on Wednesday, 14 September 2005 18:13:24 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:04 UTC