Re: Inheritance of "mixed"

"Michael Kay" <mhk@mhk.me.uk> writes:

> Where a complex type A does not specify "mixed" (either on the complexType
> element or the complexContent element), and is derived by extension from a
> complex type B that specifies mixed="yes", Xerces and XSV both appear to
> treat A as allowing mixed content.
>
> They are presumably doing the right thing, and it seems a sensible thing to
> do, but I can't find anything in the spec that justifies it. As I read the
> rules, the "effective mixed" of A is false, and there is then a violation of
> the constraint Derivation Valid (Extension): 1.4.3.2.2.1 Both {content
> type}s must be mixed or both must be element-only.

There has been some reworking of all this in the PER [1] but in
general you're right, and XSV (2.7, anyway) reports the error in e.g.

 <xs:complexType name="b2" mixed="true">
  <xs:sequence>
   <xs:element name="a"/>
  </xs:sequence>
 </xs:complexType>

 <xs:complexType name="e6x">
  <xs:complexContent>
   <xs:extension base="b2">
    <xs:sequence>
     <xs:element name="b"/>
    </xs:sequence>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>

If either of the type defs is empty the rules are different, however
-- was that the case in your example?

ht

[1] http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/structures-with-errata.html#declare-type
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]

Received on Friday, 17 September 2004 08:51:56 UTC