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

Re: Fw: SimpleType, SimpleContent, Redefine

From: Bruno Chatel <bcha@chadocs.net>
Date: Wed, 20 Mar 2002 20:39:10 +0100
Message-ID: <051501c1d046$e9079180$0600a8c0@chafou>
To: "Eric van der Vlist" <vdv@dyomedea.com>
Cc: <xmlschema-dev@w3.org>, "patt" <pattar@tireme.fr>, <bcha@chadocs.com>
Thanks for this response, 

> >  I would like to know if the following compleType defintion is allowed:
> > 
> >  <xs:complexType name="unit">
> >        <xs:simpleContent>
> >             <xs:extension base="xs:integer"/>
> >        </xs:simpleContent>
> >   </xs:complexType>
> 
> Yes, why not ;=) ?
> 
> >  It seems to be equivalent than :
> > 
> >  <xs:simpleType name="unit">
> >      <xs:restriction  base="xs:integer"/>
> >  <xs:simpleType>
> 
> Not really, simple and complex types are very different beasts (despite 
> similarities which are IMO exagerated in the W3C Recommendation) and the 
> kind of derivations which you will be able to do on those types is 
> different.


My initial understanding of the difference was that simpleType was used
for data (i.e. content of leaf nodes) and complexType for "structured" content
model (including attribute definitions).

So, it means that the way to decide if I use a simpleType or a complexType for
defining "unit" is driven by the usage (in term of derivation) of it ? 
And not by the content model it describes ?

Then imagine that I want to use unit for
1- apply a facet (for example maxExclusive) for defining a particular limited unit
AND
2- define a complexType  in an other schema (importing this one) by redefine
mecanism

I can't do this because :
1- implies to use a simpleType
2- implies to use a complexType


Regards,

-- bruno -- 
Bruno Chatel
Tel : (+33)[0] 4 96 11 14 57
Email : bcha@chadocs.com
http://www.chadocs.com
----------------------------------------
Received on Wednesday, 20 March 2002 14:37:11 GMT

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