This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
<xs:complexType name="B" mixed="true"> <xs:sequence> <xs:element name="e" type="xs:int" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="R"> <xs:simpleContent> <xs:restriction base="B"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:restriction> </xs:simpleContent> </xs:complexType> The CDT for "e" in "B" is "xs:int". What's the CDT for "e" in "R". Currently it's "absent". Question: should it also be "xs:int" (i.e. inherit from "B")? Some WG members, during the F2F, felt that it should inherit from "B". This can be "fixed" by removing "or CTD's {content type} has simple {variety}". This is where my Action item came from. We wanted to make sure such change wouldn't have any negative impact. Because one can not derive from a complex type with simple content and add element children to it (i.e. go from simple content to complex content), whether simple content use absent or inherit doesn't make any difference in most cases. The only case it affects (that I can think of now) is the following. Consider the above complex types and the following instance: <p xsi:type="R"> <e>abc</e> </p> Obviously <p> is invalid, because "R" has simple content and doesn't allow <e>. But what happens to <e>? If "R" uses "absent" as CDT for <e>, then as a consequence <e> doesn't have a governing type definition. It will be laxly assessed using xs:anyType. But if "R" inherits CDT from "B", then <e> has xs:int as its CDT and governing type, and will be flagged invalid because its content "abc" is not a valid int. Which is the right behavior? (I'm leaning a little toward inherit. i.e. make the change suggested by this action item.) [1] http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.html#key-cdt [2] http://www.w3.org/XML/Group/2007/01/xml-schema-ftf-minutes#fripm.vm3
The WG discussed this issue at 2007-06-27 F2F meeting, and decided to remove "or CTD's {content type} has simple {variety}", which effectively says that context determined type is always inherited by derived types.
The repair agreed on in June has been included in the current status-quo version of the spec at http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.html So I'm changing this from 'decided' to 'resolved'.