complexType derivation method

I have some problems in deriving new complextype:
  1.. Can I create a new complexType with a simpleContent by restricting or extending a basetype which is itself derived by restriction or extension ?
<xs:complexType name="1" mixed="true">
    <xs:simpleContent>
        <xs:extension base="xs:string">
            <xs:attribute name="x" type="xs:integer"/>
        </xs:extension>
    </xs:simpleContent>
</xs:complexType>
<xs:complexType name="2">
    <xs:simpleContent>
        <xs:extension base="1">
            <xs:attribute name="b" type="xs:string"/>
        </xs:extension>
    </xs:simpleContent>
</xs:complexType>
<xs:complexType name="3>
    <xs:simpleContent>
        <xs:restriction base="1">
            <xs:minLength value="2"/>
        </xs:restriction>
    </xs:simpleContent>
</xs:complexType>
    2.    when i create a new complexType with a complexContent , can i restrict a base type removing one or more child elements?

<xs:complexType name="Com">
    <xs:sequence>
        <xs:element name="B" type="xs:string"/> 
        <xs:element name="C" type="xs:integer"/>
        <xs:element name="D" type="xs:string" maxOccurs="unbounded"/> 
    </xs:sequence>
</xs:complexType>
<xs:complexType name="Comrestr">
    <xs:complexContent>
        <xs:restriction base="Com">
            <xs:sequence>
                <xs:element name="B" type="xs:string"/>
                <xs:element name="C" type="xs:integer"/> 
            </xs:sequence>
        </xs:restriction>
    </xs:complexContent>
</xs:complexType> 
    3.    May someone explain to me,even by an example, the use and meaning of <simpleType> as a child of a <simpleContent>...<restriction> ? 
<xs:complexType name="...">
    <xs:simpleContent>
        <xs:restriction base="..." > 
            <xs:simpleType name="...">
thanks for your help,
    andrea  mailto:aboriero@hoc.elet.polimi.it

Received on Wednesday, 9 January 2002 04:07:44 UTC