Hi,

Need some help in solving problems of abstract types. I have the following elements:

<xs:element name="Root">
     <xs:complexType>
          <xs:sequence>
               <xs:element ref="AbstractClass"/>
          </xs:sequence>
     </xs:complexType>
</xs:element>

<element name="AbstractClass" abstract="true">

<element name="classA" type="ClassAType" substitutionGroup="AbstractElement">

<element name="classB" type="ClassBType" substitutionGroup="AbstractElement">

I need an output XML of the form

<root>
  <classA>...........</classA>
</root>

but i get the following:

<root>
  <AbstractClass>
    <classA>...........</classA>
  </AbstractClass>     
</root>

In the java code i have the following options

a) root.addNewAbstractClass();
b) root.setAbstractClass(XmlObject xmlObject);

I want to get only the implementation of the "AbstractClass" as the sub-element of the "Root" element, how is it possible to achieve this.

Thanks in advance,

Cheers,
Satish



Reply via email to