[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: multi-inheritance
The shape of your schema is fine. The details were not quite right -- here's a cleaned-up version: <xs:schema targetNamespace="urn:xmlns:25hoursaday-com:customer" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cust="urn:xmlns:25hoursaday-com:customer" elementFormDefault="qualified"> <xs:complexType name="Person" abstract="true"> <xs:sequence> <xs:element name="Name"/> <xs:element name="Job"/> <xs:element name="Power" type="cust:powerType"/> </xs:sequence> </xs:complexType> <xs:simpleType name="powerType"> <xs:restriction base="xs:string"> <xs:enumeration value="10Pounds"/> <xs:enumeration value="1000Pounds"/> </xs:restriction> </xs:simpleType> <xs:complexType name="Man"> <xs:complexContent> <xs:extension base="cust:Person"> <xs:sequence> <xs:element name="married"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="SuperMan"> <xs:complexContent> <xs:restriction base="cust:Man"> <xs:sequence> <xs:element name="Name"/> <xs:element name="Job"/> <xs:element name="Power"> <xs:simpleType> <xs:restriction base="cust:powerType"> <xs:enumeration value="10Pounds"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="married"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:schema> -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh Half-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@c... URL: http://www.ltg.ed.ac.uk/~ht/ [mail really from me _always_ has this .sig -- mail without it is forged spam]
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|