<sequence>, <all>, or <choice>?
Posted: Mon Dec 26, 2005 11:46 pm
I've defined an element that contains other elements. As far as I am concerned, the contained elements may appear in any order. The ixx, iyy, and izz elements are required and must appear once. The ixz, ixy, and iyz elements are each optional, and may appear once each. The ptmass element may or may not appear at all - and it may appear any number of times. I haven't yet been able to figure out how I can write a schema for this.
Right now, I've got this:
This is problematic, only because I cannot specify the pointmass object as occurring any number of times.
Do I have any alternatives? The <sequence> item would work, except that the contained elements can appear in any order.
Jon
Right now, I've got this:
Code: Select all
<xs:complexType>
<xs:all>
<xs:element ref="ixx" minOccurs="1"/>
<xs:element ref="iyy" minOccurs="1"/>
<xs:element ref="izz" minOccurs="1"/>
<xs:element ref="ixy"/>
<xs:element ref="ixz"/>
<xs:element ref="iyz"/>
<xs:element ref="emptywt" minOccurs="1"/>
<xs:element ref="location" minOccurs="1"/>
<xs:element ref="ptmass" minOccurs="0" maxOccurs="unbounded"/>
</xs:all>
</xs:complexType>
Do I have any alternatives? The <sequence> item would work, except that the contained elements can appear in any order.
Jon