Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[XML Schema 1.1] Two ways to create interleaved, any-order content

From: "Costello, Roger L." <costello@-----.--->
To: "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>



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent