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

Re: XML Schemas: Best Practices

  • From: "Roger L. Costello" <costello@m...>
  • To: xml-dev@l...
  • Date: Thu, 18 Jan 2001 11:10:04 -0500

Re: XML Schemas: Best Practices
Jeff Rafter wrote:
> Eddie,
> > I may be on thin ice here but I don't think this is correct. If you use
> > derivation using the above syntax you're not reordering the elements.
> Instead
> > you are extending the type to allow for all the elements in the base type
> I believe you are right.  I think that Martin's intent was to use a
> restriction element instead of an extension element (correct me if I am
> wrong).  This would make his example:
>      <complexType name="BookTypePlusReviewer">
>         <complexContent>
>              <restriction base="c:BookType" >
>                  <sequence>
>                      <element name="Reviewer" type="string"/>
>                      <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>
>             </restriction>
>         </complexContent>
>     </complexType>

Great discussions!  

No, using <restriction> does not allow me to put a Reviewer element at
the top of Book's content model.  The <restriction> functionality only
allows me to 

- restrict the range of values, or 
- restrict the number of occurrences of an element

It does not allow me to add (extend) a content model.  The only way to
add (extend) a content model is with <extension>, and the extension is
always at the end of the content model.
> using:
> <any namespace="##any" minOccurs="0" maxOccurs="2"/>
> at the top of the sequence seems to be a good idea until you consider
> multiple layers of inheritance-- then you realize that a more extensive (no
> pun intended) solution is needed.  

I don't know what you mean by "multiple layers of inheritance".  Could
you expand upon this please?  Thanks!  /Roger


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.
First Name
Last Name
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.