XSD seems to have a limitation when trying to create an abstract class and a derived class. It seems to want the elements in both to be enclosed in <sequence> and not in <all>.
For instance, the XSD at the bottom of this post is correctly parsed.
But, if i change those <sequence> elements to <all>, there is a parsing error. As far as i know, the only difference should be whether the elements within the classes are required to be in sequence or not (our server does not require that they be in sequence). But, my XSD parser objects to <all> being within an Extension.
So, does anybody know how to handle the case illustrated, if the elements are not required to be in sequence?
Thanks,
tom
Code:
-----XSD example, this works, but not with <all>--------
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="elementFormDefault="qualified"
xmlns="xmlns:mstns="xmlns:xs="xmlns:xsd=">
<xsd:complexType name="basec" abstract="true">
<xsd:sequence>
<xsd:element name="e1"/>
<xsd:element name="e2"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="derived">
<xsd:complexContent>
<xsd:extension base="basec">
<xsd:sequence>
<xsd:element name="e3"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xs:schema>
For instance, the XSD at the bottom of this post is correctly parsed.
But, if i change those <sequence> elements to <all>, there is a parsing error. As far as i know, the only difference should be whether the elements within the classes are required to be in sequence or not (our server does not require that they be in sequence). But, my XSD parser objects to <all> being within an Extension.
So, does anybody know how to handle the case illustrated, if the elements are not required to be in sequence?
Thanks,
tom
Code:
-----XSD example, this works, but not with <all>--------
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="elementFormDefault="qualified"
xmlns="xmlns:mstns="xmlns:xs="xmlns:xsd=">
<xsd:complexType name="basec" abstract="true">
<xsd:sequence>
<xsd:element name="e1"/>
<xsd:element name="e2"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="derived">
<xsd:complexContent>
<xsd:extension base="basec">
<xsd:sequence>
<xsd:element name="e3"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xs:schema>