[
Lists Home |
Date Index |
Thread Index
]
> -----Original Message-----
> From: Murali Mani [mailto:mani@CS.UCLA.EDU]
> Sent: Saturday, 18 May 2002 2:44 AM
> To: Dare Obasanjo
> Cc: Eddie Robertsson; Nada Reinprecht; xml-dev@lists.xml.org
> Subject: RE: [xml-dev] Two quick questions regarding restriction in XML
> Schema
>
>
>
> I hope to finish the report soon, of course (couple of days at most), I
> will try to announce it on the list, and to you people who have helped me
> immensely.
>
> I have one question regarding extension:
> can we define the following types
> type Book -> (Title, Author+)
> type Book1 extends Book -> (Title, Author+, Title)
<snip/>
Hi. W3C schema example of what you request.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="Book">
<xs:sequence>
<xs:element name="Title" type="xs:string"/>
<xs:element name="Author" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Book1">
<xs:complexContent>
<xs:extension base="Book">
<xs:sequence>
<xs:element name="Title" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
Regards
Michael
|