W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2002

Re: A complex type cannot be a restriction of a simpleType ??

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 07 Oct 2002 18:11:39 +0100
To: Anli Shundi <ashundi@tibco.com>
Cc: "'Stefan Wachter'" <Stefan.Wachter@gmx.de>, Ted Toth <ted.toth@vincera.com>, xmlschema-dev@w3.org
Message-ID: <f5blm5aqilw.fsf@erasmus.inf.ed.ac.uk>

Anli Shundi <ashundi@tibco.com> writes:

> It is not alright:  
> 
> > >   <xsd:complexType name="ID">
> > >     <xsd:simpleContent>
> > >       <xsd:restriction base="element">
> > >         <xsd:pattern value="[A-Z\d]*"/>
> > >       </xsd:restriction>
> > >     </xsd:simpleContent>
> > >   </xsd:complexType>
> 
> the complexType "ID" should have instead been a simpleType.
> 
> http://www.w3.org/TR/xmlschema-1/#src-ct point 2 is fulfilled but
> point 2 of http://www.w3.org/TR/xmlschema-1/#ct-props-correct is not:
> 
> 2 If the {base type definition} is a simple type definition, the {derivation
> method} must be extension. 

But the base is _not_ a simple type definition, it's a complex type
definition with simple content, and it's perfectly OK to restrict
that.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2002, 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/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Monday, 7 October 2002 13:11:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT