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

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

  • From: Roger Costello <costello@m...>
  • To: www-xml-schema-comments@w..., xml-dev@x...
  • Date: Fri, 25 Feb 2000 07:02:50 -0500

xml schema open model
"Box, Don" wrote:
>  
> Look at element and attribute wildcards (<any/> and <anyAttribute/>
> respectively). They subsume the functionality of the old 
> model=open/closed attribute. 
> 
> Had your "Book" type been defined as follows:
> 
> >       <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"/>
> >                <any minOccurs='0' maxOccurs='*'/>
> >            </type>
> >       </element>
> 
> You would have been fine.
> 

The <any> element does not quite give the same functionality as the old
open content model functionality.  True, as you show above, it allows me
to put any well formed XML immediately after a <Publisher> element. 
However, with the old open content model capability, I could declare the
Book element to be open, i.e., 

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

and in so doing it would enable me to place well-formed XML anywhere
within Book, e.g., I would be able to put the <AuthorsWebPage> element
before <Title>, or before <Author> etc.  Below I show it placed before
the <Date> element:

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

I suppose that I could simulate the open functionality by placing <any>
element declarations everywhere:

       <element name="Book">
            <type>
                <any minOccurs='0' maxOccurs='*'/>
                <element name="Title" type="string"/>
                <any minOccurs='0' maxOccurs='*'/>
                <element name="Author" type="string"/>
                <any minOccurs='0' maxOccurs='*'/>
                <element name="Date" type="string"/>
                <any minOccurs='0' maxOccurs='*'/>
                <element name="ISBN" type="string"/>
                <any minOccurs='0' maxOccurs='*'/>
                <element name="Publisher" type="string"/>
                <any minOccurs='0' maxOccurs='*'/>
            </type>
       </element>

Personally, I don't find this to be a very appealing idea.  I vote that
we reinstantiate the old model="open" functionality.  /Roger


***************************************************************************
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.