Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - >Thread Next - Re: [XML Schema 1.1] Two ways to create interleaved, any-order [XML Schema 1.1] Two ways to create interleaved, any-order contentTo: "xmlschema-dev@--.---" <-------------@--.---> Date: 10/12/2009 5:02:00 PM
Hi Folks,
Below are two ways to declare a <Book> element.
Both versions use <all>, to permit the elements within <Book> to occur in any order.
The first version uses an unbounded <any>. The second version uses interleaved open content.
Are these two versions identical? If so, is there an advantage of one over the other? If they are not identical, how do they differ?
/Roger
VERSION #1
<xs:element name="Book">
<xs:complexType>
<xs:all>
<xs:any maxOccurs="unbounded" />
<xs:element name="Author" type="xs:string" />
<xs:element name="Title" 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:all>
</xs:complexType>
</xs:element>
VERSION #2
<xs:element name="Book">
<xs:complexType>
<xs:openContent mode="interleave">
<xs:any />
</xs:openContent>
<xs:all>
<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:all>
</xs:complexType>
</xs:element>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
