[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Two quick questions regarding restriction in XML Schema
> -----Original Message----- > From: Murali Mani [mailto:mani@C...] > Sent: Saturday, 18 May 2002 2:44 AM > To: Dare Obasanjo > Cc: Eddie Robertsson; Nada Reinprecht; xml-dev@l... > Subject: RE: 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
|
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
|