L
Lars Geldner
Hello,
I'm searching for a possibility to define a complex type using xml
schema that can only be derived by restriction. The sub-complex type
should have a content model that only contains elements which have types
that are subsets of the element types in the super-complex type.
For example:
<xs:element name="A" type="A_Type" abstract="true"/>
<xs:element name="B" type="B_Type" abstract="true"/>
<xs:complexType name="A_Type">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="A" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="B" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="B_Type"/>
Elements A and B can appear in any order.
Now I want to derive "A_Type" to such an extent that the sub-type
defines only elements that are members of the same substitutionGroup
like A and B and appear in a special order:
<xs:complexType name="a_A_Type">
<xs:complexContent>
<xs:extension base="A_Type">
<xs:sequence>
<xs:element ref="a_B" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="a_A" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="a_B" type="B_Type" substitutionGroup="B"/>
<xs:element name="a_A" type="A_Type" substitutionGroup="A"/>
My parser says:
Ambiguous content model in the effective content model of complexType
A_Type: the following particles overlap:
<xs:element maxOccurs="unbounded" minOccurs="0" ref="A"/>,
<xs:element maxOccurs="unbounded" minOccurs="0" ref="a_A"/>
because the two particles are members of the same substitution Group.
I'm searching for a construct that has the same task like a interface in
Java.
TIA,
Lars Geldner
I'm searching for a possibility to define a complex type using xml
schema that can only be derived by restriction. The sub-complex type
should have a content model that only contains elements which have types
that are subsets of the element types in the super-complex type.
For example:
<xs:element name="A" type="A_Type" abstract="true"/>
<xs:element name="B" type="B_Type" abstract="true"/>
<xs:complexType name="A_Type">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="A" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="B" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="B_Type"/>
Elements A and B can appear in any order.
Now I want to derive "A_Type" to such an extent that the sub-type
defines only elements that are members of the same substitutionGroup
like A and B and appear in a special order:
<xs:complexType name="a_A_Type">
<xs:complexContent>
<xs:extension base="A_Type">
<xs:sequence>
<xs:element ref="a_B" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="a_A" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="a_B" type="B_Type" substitutionGroup="B"/>
<xs:element name="a_A" type="A_Type" substitutionGroup="A"/>
My parser says:
Ambiguous content model in the effective content model of complexType
A_Type: the following particles overlap:
<xs:element maxOccurs="unbounded" minOccurs="0" ref="A"/>,
<xs:element maxOccurs="unbounded" minOccurs="0" ref="a_A"/>
because the two particles are members of the same substitution Group.
I'm searching for a construct that has the same task like a interface in
Java.
TIA,
Lars Geldner