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

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

           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:choice>
   <xs:complexType>
 
   <xs:element name="root">
     <xs:complexType>
       <xs:complexContent>
         <xs:extension base="test:mixed">
           <xs:attribute name="id" type="xs:ID"/>
         <xs:extension>
       <xs:complexContent>
     <xs:complexType>
   <xs:element>

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

 <root xmlns="http://example.com/test">
   ccc<a>aaa<b>bbb<b>aaa<a>ccc<b>bbb<a>aaa<a>bbb<b>ccc
 <root>

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. 

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

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