Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - >Thread Next - Re: [XML Schema 1.1] Does defaultOpenContent allow me to add [XML Schema 1.1] Does defaultOpenContent allow me to add extensionTo: "'xmlschema-dev@--.---'" <-------------@--.---> Date: 6/4/2009 7:52:00 PM
Hi Folks,
Consider this schema, which uses <defaultOpenContent> to make the entire schema open:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.books.org"
xmlns="http://www.books.org"
elementFormDefault="qualified">
<xs:defaultOpenContent mode="interleave">
<xs:any />
</xs:defaultOpenContent>
<xs:element name="BookStore">
<xs:complexType>
<xs:sequence>
<xs:element name="Book" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Title" type="xs:string"/>
<xs:element name="Author" type="xs:string" />
<xs:element name="Date" type="xs:string"/>
<xs:element name="ISBN" type="xs:string"/>
<xs:element name="Publisher" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Can I add extension elements before and after the root element (BookStore)?
Is this instance document legal (I have wrapped the root element with an extension element):
<?xml version="1.0"?>
<r:MyFavoriteBookStore xmlns:r="http://www.bookrepository.org">
<BookStore xmlns="http://www.books.org">
<Book>
<Title>My Life and Times</Title>
<Author>Paul McCartney</Author>
<Date>1998</Date>
<ISBN>1-56592-235-2</ISBN>
<Publisher>McMillin Publishing</Publisher>
<r:Binding>Hardcover</r:Binding>
</Book>
<Book>
<r:Size>5 x 7</r:Size>
<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>
<Book>
<Title>The First and Last Freedom</Title>
<Author>J. Krishnamurti</Author>
<r:NumPages>299</r:NumPages>
<Date>1954</Date>
<ISBN>0-06-064831-7</ISBN>
<Publisher>Harper & Row</Publisher>
</Book>
</BookStore>
</r:MyFavoriteBookStore>
/Roger
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
