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

XML Schemas: lost "open content models"?

  • From: "Roger L. Costello" <costello@m...>
  • To: www-xml-schema-comments@w..., xml-dev@x...
  • Date: Thu, 24 Feb 2000 15:59:38 -0500

xml open content model
Hi Folks,

In an earlier incarnation of the XML Schema spec it allowed you to state
that the content of an element is "open".  

My question is:  What happened to it?  Is it there in the current spec,
but under a different guise? Or, if it's not there, is it coming back in
the next version of the spec?

Below is some background on "open content models" for those who are
interested.  /Roger

Definition of "open content model": if an element is declared "open" in
the schema then in the instance document the element" can contain child
elements not listed in the schema.  For example, consider this XML
Schmema:

      <element name="Book">
           <type>
               <element name="Title" type="string"/>
               <element name="Author" type="string"/>
               <element name="Date" type="string"/>
               <element name="ISBN" type="string"/>
               <element name="Publisher" type="string"/>
           </type>
      </element>

This element declaration mandates that in an instance document a Book
element must contain five child elements - Title, Author, Date, ISBN,
and Publisher.  For example:

     <Book>
         <Title>Illusions The Adventures of a Reluctant Messiah</Title>
         <Author>Richard Bach</Author>
         <Date>1977</Date>
         <ISBN>0-440-34319-4</ISBN>
         <Publisher>Dell Publishing Co.</Publisher>
     </Book>

Suppose that, in the instance document, you wanted to add another child
element of Book - perhaps you would like to add a link to Richard Bach's
web page:

     <Book>
         <Title>Illusions The Adventures of a Reluctant Messiah</Title>
         <Author>Richard Bach</Author>
         <Date>1977</Date>
         <ISBN>0-440-34319-4</ISBN>
         <Publisher>Dell Publishing Co.</Publisher>
         <AuthorsWebPage xlink:href="http://www.rbach.com"/>
     </Book>

An XML Schema parser will flag this instance document as invalid.  
Ideally, however, we would like for the XML Schema parser to ignore
elements that are not defined in the schema.  Thus, in this example it
would ignore the <AuthorsWebPage> element.  Applications that know how
to deal with <AuthorsWebPage> would have the benefit of having a
hyperlink to the author's web page.

This ability to add elements in the instance document beyond those
declared in the schema (and having the XML Schema parser ignore them) is
what is mean't by an "open content model".  Declaring the Book element
to be "open" would enable instance documents to add elements not
specified in the schema.


***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/threads.html
***************************************************************************

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.