OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]
  • From: Roger Costello <costello@mitre.org>
  • To: www-xml-schema-comments@w3c.org, xml-dev@xml.org
  • Date: Fri, 25 Feb 2000 07:02:50 -0500

"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@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/threads.html
***************************************************************************




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS