I'm unable to use the "xsd:all" tag in derived objects, in a hierarchical schema setup. For example, I have the following schema (that doesn't validate with XMLSpy):
(UserOfDerived extends Derived extends Base)
<!-- Base.xsd -->
....
<xsd:complexType name = "Base" abstract = "true">
<attribute name = "revision" type = "xsd:string"/>
<attribute name="id" type="xsd:ID"/>
</xsd:complexType>
....
And I derive most of my objects from this as follows:
<!-- Derived.xsd -->
<complexType name="Derived">
<complexContent>
<extension base="Base">
<all>
<element name="DerivedElement1" type="xsd:string" minOccurs="0"/> <element name="DerivedElement2" type="xsd:string" minOccurs="0"/> <element name="DerivedElement2" type="xsd:string" minOccurs="0"/> <element name="DerivedElement4" type="xsd:string" minOccurs="0"/> </all> </extension> </complexContent> </complexType> ....
And finally, I want to extend the Derived object in other objects, as follows:
<!-- UserOfDerived.xsd -->
....
<xsd:complexType name = "UserOfDerived">
<xsd:complexContent>
<xsd:extension base = "Derived">
<xsd:all>
<xsd:element name = "UserOfDerivedElement1" type = "xsd:string" minOccurs = "0"/> <xsd:element name = "UserOfDerivedElement2" type = "xsd:string" minOccurs = "0"/> <xsd:element name = "UserOfDerivedElement3" type = "xsd:string" minOccurs = "0"/> <xsd:element name = "UserOfDerivedElement4" type = "xsd:string" minOccurs = "0"/> <xsd:element name = "UserOfDerivedElement5" type = "xsd:string" minOccurs = "0"/> </xsd:all> </xsd:extension> </xsd:complexContent> </xsd:complexType> .....
None of this validates with any XML parser. If I convert all "xsd:all" types to "xsd:sequence" types, it works, but that's not what I want (my XML message will contain elements in random order, so it's important that the schema not reflect any ordering).
Any suggestions?
Thanks in advance.
(UserOfDerived extends Derived extends Base)
<!-- Base.xsd -->
....
<xsd:complexType name = "Base" abstract = "true">
<attribute name = "revision" type = "xsd:string"/>
<attribute name="id" type="xsd:ID"/>
</xsd:complexType>
....
And I derive most of my objects from this as follows:
<!-- Derived.xsd -->
<complexType name="Derived">
<complexContent>
<extension base="Base">
<all>
<element name="DerivedElement1" type="xsd:string" minOccurs="0"/> <element name="DerivedElement2" type="xsd:string" minOccurs="0"/> <element name="DerivedElement2" type="xsd:string" minOccurs="0"/> <element name="DerivedElement4" type="xsd:string" minOccurs="0"/> </all> </extension> </complexContent> </complexType> ....
And finally, I want to extend the Derived object in other objects, as follows:
<!-- UserOfDerived.xsd -->
....
<xsd:complexType name = "UserOfDerived">
<xsd:complexContent>
<xsd:extension base = "Derived">
<xsd:all>
<xsd:element name = "UserOfDerivedElement1" type = "xsd:string" minOccurs = "0"/> <xsd:element name = "UserOfDerivedElement2" type = "xsd:string" minOccurs = "0"/> <xsd:element name = "UserOfDerivedElement3" type = "xsd:string" minOccurs = "0"/> <xsd:element name = "UserOfDerivedElement4" type = "xsd:string" minOccurs = "0"/> <xsd:element name = "UserOfDerivedElement5" type = "xsd:string" minOccurs = "0"/> </xsd:all> </xsd:extension> </xsd:complexContent> </xsd:complexType> .....
None of this validates with any XML parser. If I convert all "xsd:all" types to "xsd:sequence" types, it works, but that's not what I want (my XML message will contain elements in random order, so it's important that the schema not reflect any ordering).
Any suggestions?
Thanks in advance.