Here are two xsd definitions, both of them are almost 90% similar.Below are the skeleton of the first xsd:
XSD1 :
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="apf2doc">
<xs:complexType>
<xs:sequence>
<xs:element ref="request"/>
<xs:element ref="account"/>
<xs:element ref="financial_transaction"/>
<xs:element ref="event_data" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
And second xsd is:
XSD2:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="apf2doc">
<xs:complexType>
<xs:sequence>
<xs:element ref="request"/>
<xs:element ref="account"/>
<xs:element ref="message"/>
<xs:element ref="event_data" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Now these two xsds generate two sets of classes in two different packages. I am using JAXB to unmarshall the xmls received. The xmls are generated from these two xsds.
While creating a JAXB context it throws me error because most of the classes cause conflict I believe.
Here is the error trace:
The element name {}userid has more than one mapping. This problem is related to the following location:
at public javax.xml.bind.JAXBElement
generated.order.ObjectFactory.createUserid(java.lang.String) at
generated.order.ObjectFactory this problem is related to the following location:
at public javax.xml.bind.JAXBElement
generated.usage.ObjectFactory.createUserid(java.lang.String) at
generated.usage.ObjectFactory
It would be great if someone can suggest me any solution.
Thanks.