[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML Schemas: Best Practices

  • From: Caroline Clewlow <cclewlow@e...>
  • Date: Fri, 19 Jan 2001 09:21:49 +0000

xml schema type inheritence
That's a good point !  I guess with allowing any kind of openness and/or
extensibility in a conent model, there's a danger of 'losing control' of the
original type definition.

Would there be any way, if necessary, of limiting the number of times a
particular type can be extended ?

Hope I'm not heading us off topic here :-)

Regards

Caroline

Jeff Rafter wrote:

> > No, using <restriction> does not allow me to put a Reviewer element at
> > the top of Book's content model.
>
> Oof... must have been late-- I don't know what I was thinking.  You are
> absolutely correct.
>
> > I don't know what you mean by "multiple layers of inheritance".  Could
> > you expand upon this please?  Thanks!  /Roger
>
> What I meant was certain types may be extended multiple times by different
> people.  I think the example of BookType is a good one
>
>    <complexType name="BookType">
>         <sequence>
>             <element name="Title" type="string"/>
>             <element name="Author" type="string"/>
>             <element name="Date" type="year"/>
>             <element name="ISBN" type="string"/>
>             <element name="Publisher" type="string"/>
>         </sequence>
>     </complexType>
>     <complexType name="NonfictionBookType">
>         <complexContent>
>             <extension base="c:BookType">
>                 <sequence>
>                     <element name="Reference" type="boolean"/>
>                 </sequence>
>             </extension>
>         </complexContent>
>     </complexType>
>     <complexType name="EncyclopediaBookType">
>         <complexContent>
>             <extension base="c:NonfictionBookType">
>                 <sequence>
>                     <element name="Volume" type="string"/>
>                 </sequence>
>             </extension>
>         </complexContent>
>     </complexType>
>
> and so on... "multiple layers of inheritence" is probably bad use of the
> terms, but in the above we can see that EncyclopediaBookType extends
> NonfictionBookType extends BookType.  It seems that if we are planning for
> extension we often need to consider that those extensions will be extended,
> will be extended...
>
> Thanks,
> Jeff Rafter


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.