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




> 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