I have an XML -Data with the following structure
<Data>
<Name />
<Code />
<Prodprop>
<key />
<value />
</Prodprop>
<Prodprop>
<key />
<value />
</Prodprop>
<Tag />
<Blub />
</Data>
I need an XML Schema for this data , but the tags can appear in any order, but all Prodprop are consecutive. All other elements are needed exactly once or maximal once Therefore the following data is also valid.
<Data>
<Code />
<Name />
<Tag />
<Prodprop>
<key />
<value />
</Prodprop>
<Prodprop>
<key />
<value />
</Prodprop>
</Data>
This i my (and i know that this is not possible) Schema.
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Data" type="DataType" />
<xsd:complexType name="DataType">
<xsd:all>
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="Code" type="xsd:string" />
<xsd:element maxOccurs="unbounded" name="Prodprop" type="ProdpropType" />
<xsd:element name="Tag" type="xsd:string" />
<xsd:element name="Blub" type="xsd:string" />
</xsd:all>
</xsd:complexType>
<xsd:complexType name="ProdpropType">
<xsd:sequence>
<xsd:element name="key" type="xsd:string" />
<xsd:element name="value" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Is there a possibility to make for this szenario a valid xml schema ?