W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2001

Re: [Moderator Action] complexType / simpleContent / restriction vs extension

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 10 Jan 2001 09:03:06 +0000
To: "Mark Young" <mark@kamiak.com>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5bn1czlqyd.fsf@cogsci.ed.ac.uk>
"Mark Young" <mark@kamiak.com> writes:

> In section 4.3.3 of "XML Schema Part 1..." restriction has
> simpleType as one of its allowed content items, while extension does
> not (this under complexType / simpleContent).  This seems
> inconsistent; why is it allowed for restriction but not for
> extension?

You can never extend a simpleType with another simpleType -- this
would mean some kind of concatenation, I guess, and we've never chosen 
to support this.  This is true for both ordinary simple types, and
complex types with simple content.  What had you thought e.g.

  <xs:extension base="xs:string">
     <xs:restriction base="xs:integer"/>

would mean?

> Also, I don't believe that the normative schema schema has this for
> complexType/simpleContent/restriction (i.e. no simpleType in the
> content).

Here is the type definition for <extension> when it appears inside

 <complexType name="simpleExtensionType">
   <restriction base="extensionType">
      <documentation xml:lang="en">
      No typeDefParticle group reference</documentation>
     <element ref="annotation" minOccurs="0"/>
     <group ref="attrDecls"/>

As you can see, it does _not_ allow <simpleType>, but only attribute

  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Wednesday, 10 January 2001 04:03:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:49 UTC