OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML Schemas: Best Practices



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