Regarding your question on derivation.  As stated in [1]:

"Each simple type definition, whether built-in (that is, defined in [XML Schemas: Datatypes]) or user-defined, is a restriction of some particular simple base type definition, which can be the ur-type definition, or specifies a type whose members are lists of items themselves constrained by some other simple type definition."

And from [2]:

" Each complex type definition is either
* A restriction of a complex base type definition
or
* an extension of a simple or complex base type definition
or
* A restriction of the ur-type definition

Finally, in part two (the datatypes specification) is given the syntax of the <simpleType> declaration [3].  There you will find that the derivedBy attribute on simpleType defaults to "restriction".  The alternative that you can specify is "list". I hope this answers your question.  

Noah

[1] http://www.w3.org/TR/xmlschema-1/#Simple_Type_Definition
[2] http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition
[3] http://www.w3.org/TR/xmlschema-2/#xr-defn

------------------------------------------------------------------------
Noah Mendelsohn                                    Voice: 1-617-693-4036
Lotus Development Corp.                            Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142
------------------------------------------------------------------------





Liz <lcastro@cookwood.com>
Sent by: www-xml-schema-comments-request@w3.org

08/08/00 09:26 PM
Please respond to lcastro

       
        To:        www-xml-schema-comments@w3.org
        cc:        (bcc: Noah Mendelsohn/CAM/Lotus)
        Subject:        derivedBy in simple and complex types


(Trying another email client to avoid the attachments. Again, profuse
apologies!)

Could someone confirm if the derivedBy attribute is only required when
you derive a complex type, but not when you derive a simple one?

For example, there is the example in the Primer:

<xsd:simpleType name="Sku" base="xsd:string">
<xsd:pattern value="\d{3}-[A-Z]{2}"/>
</xsd:simpleType>

which validates just fine.

But when I have a complex type definition like:

<xsd:complexType name="populationType" base="xsd:integer">
<xsd:attribute name="year" use="required">
     <xsd:simpleType base="xsd:integer"/>
</xsd:attribute>

the XML Schema Validator (XSV) gives me an error and says I must use the
derivedBy extension if the base is present.

thanks,
Liz

Liz Castro
Cookwood Press
http://www.cookwood.com