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
Variable order of elements in xsd
Hi,
You have specified a model like
( (paragraph)* | (image)* | (model)* )
that is either zero or more pharagraph or zero or more image or zero or more mode.
From your message it seems that you want
(paragraph | image | model)*
That is XML Schema notation will look like
Best Regards,
George
You have specified a model like
( (paragraph)* | (image)* | (model)* )
that is either zero or more pharagraph or zero or more image or zero or more mode.
From your message it seems that you want
(paragraph | image | model)*
That is XML Schema notation will look like
Code: Select all
<xs:element name="layer">
<xs:complexType>
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="paragraph">
<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">
<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">
<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>
George