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

complexType derivation method

From: boriero <aboriero@hoc.elet.polimi.it>
Date: Tue, 8 Jan 2002 11:36:48 -0500 (EST)
Message-ID: <001a01c19862$44f9e7d0$12a7af83@pi45.cpi.polimi.it>
To: <xmlschema-dev@w3.org>
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 GMT

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