W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2006

complexContent extending complexType with simpleContent: why not?

From: Joe Pallas <pallas@cs.stanford.edu>
Date: Thu, 2 Feb 2006 13:35:39 -0800
Message-Id: <693280F9-1F70-4366-8CC5-FD85E08FE6E6@cs.stanford.edu>
To: xmlschema-dev@w3.org

I got handed a schema that contains (stripped down to the bare  
essentials) this:

<schema targetNamespace="http://example.com/myExample"  
xmlns:tns="http://example.com/myExample" xmlns="http://www.w3.org/ 
2001/XMLSchema" elementFormDefault="qualified"  

	<complexType name="BaseType" abstract="true">
			<extension base="string">
				<attribute name="myAttr" use="optional"/>

	<complexType name="DerivedType">
			<extension base="tns:BaseType"/>

	<complexType name="ExtendedType">
			<extension base="tns:DerivedType">
				<attribute name="anotherAttr" type="boolean" use="optional"/>


XSV complains about ExtendedType, saying: attempt to derive a complex  
basetype from a simple base: DerivedType.

Now, it is certainly the case that ExtendedType's content is actually  
simple, not complex, so simpleContent would be more appropriate.  But  
I can't figure out where in the rec it actually says that this is not  

I found a discussion of what seems to be exactly this issue in the  
archives.  The last word in that discussion was <http://lists.w3.org/ 
Archives/Public/xmlschema-dev/2002Aug/0059.html>, which said "I think  
you're right that this is legal."

I looked at the complex type derivation constraints in the spec, and  
I couldn't find a violation.  So, this may be bad style, but why is  
it rejected?

Received on Friday, 3 February 2006 03:42:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:32 UTC