W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2005

Must You Specify mixed="true" on extended types?

From: Eliot Kimber <ekimber@innodata-isogen.com>
Date: Thu, 08 Sep 2005 15:50:57 -0500
Message-ID: <4320A431.1090406@innodata-isogen.com>
To: xml-schema-dev <xmlschema-dev@w3.org>

I have declarations of the form:

<xs:complexType name="SomeType">
   <xs:complexContent mixed="true">
       <xs:element ref="ns:someElement"/>

<xs:element name="an-element">
       <xs:extension base="SomeType">
         <xs:attribute name="newatt" type="xs:string"/>

Xerces 2.6 and 2.7 both pass this, as does oXygen (which I believe uses 
Xerces for schema processing). An older version of Stylus Studio throws 
an error, saying that the extended type (an-element) must specify 
mixed="true" or the base type must specify mixed="false".

A reading of "Schema Component Constraint: Derivation Valid (Extension)" 
suggests that Stylus is in fact correct:

" Both {content type}s must be mixed or both must be 

But I wanted to make sure, because I would have expected the value for 
"mixed" to be inherited from the base type for extensions, regardless of 
what the nominal default value of the "mixed=" attribute is.

That is, it feels like "Simon Says" behavior to have to specify 
mixed="true" for extensions when the base complex type specifies 
mixed="true". Obviously, specifying mixed="false" when the base type 
specifies mixed="true" would be an error. But if the extending type 
specifies nothing for mixed, it should reflect the value specified for 
the base type.

Also, if this is required by the spec, then Xerces appears to not be 
validating it all, because in my tests it didn't catch the case where 
two declarations explicitly disagree on the value for mixed=.


W. Eliot Kimber
Professional Services
Innodata Isogen
9390 Research Blvd, #410
Austin, TX 78759
(512) 372-8155

Received on Thursday, 8 September 2005 20:48:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:08 UTC