Variable order of elements in xsd
Posted: Thu Nov 11, 2004 7:24 pm
Hallo,
this is my code:
<xs:element name="layer">
<xs:complexType>
<xs:choice>
<xs:element name="paragraph" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="position" type="xs:string"/>
<xs:attribute name="alignment" type="xs:string"/>
<xs:attribute name="character_size" type="xs:decimal"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="image" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="position" type="xs:string"/>
<xs:attribute name="scale" type="xs:decimal"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="model" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="position" type="xs:string"/>
<xs:attribute name="rotate" type="xs:string"/>
<xs:attribute name="scale" type="xs:decimal"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
The problem is that I don't know and I don't wanna specify when the elements "image", "paragraph and "model" accure. I'm looking for a way to have a variable order. The Problem is, that the number of times the element accure is variable, too. It could be like this for example:
image
paragraph
image
image
Without "model" at all.
Thanx for the solution in advance.
-ODY
this is my code:
<xs:element name="layer">
<xs:complexType>
<xs:choice>
<xs:element name="paragraph" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="position" type="xs:string"/>
<xs:attribute name="alignment" type="xs:string"/>
<xs:attribute name="character_size" type="xs:decimal"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="image" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="position" type="xs:string"/>
<xs:attribute name="scale" type="xs:decimal"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="model" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="position" type="xs:string"/>
<xs:attribute name="rotate" type="xs:string"/>
<xs:attribute name="scale" type="xs:decimal"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
The problem is that I don't know and I don't wanna specify when the elements "image", "paragraph and "model" accure. I'm looking for a way to have a variable order. The Problem is, that the number of times the element accure is variable, too. It could be like this for example:
image
paragraph
image
image
Without "model" at all.
Thanx for the solution in advance.
-ODY