W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2000

Re: XML Schemas: lost "open content models"?

From: Matthew Merlo <matthew.j.merlo@lmco.com>
Date: Thu, 24 Feb 2000 14:47:01 -0700
To: www-xml-schema-comments@w3.org
Message-id: <38B5A6D5.6FC79767@lmco.com>
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

      <element name="Book">
               <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"/>

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:

         <Title>Illusions The Adventures of a Reluctant Messiah</Title>
         <Author>Richard Bach</Author>
         <Publisher>Dell Publishing Co.</Publisher>

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:

         <Title>Illusions The Adventures of a Reluctant Messiah</Title>
         <Author>Richard Bach</Author>
         <Publisher>Dell Publishing Co.</Publisher>
         <AuthorsWebPage xlink:href="http://www.rbach.com"/>

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.


I was under the impression that in order to include elements not
mentioned in the original schema, even with an open content model
explicitly declared (if such a declaration exists), they must be
assigned to a specific namespace (either with a prefix or in scope).
Is this indeed the case?
Perhaps I have distorted your definition of "open content model."

Received on Thursday, 24 February 2000 16:47:14 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:46 UTC