Hi guys,
I came across a strange issue today for which I am having serious doubts about
my Java skills!!.. if this is something very obvious and I am posing a blind
eye to it please do open my eyes!
I have an xsd say type1.xsd which has an element <xml_element> at the top level.
xml from it would look like
<xml_element>
<request>
<customer>
.....
</xml_element>
Now I have another xsd which has the same top level elements xml_element and
request but different inside. xml complying to it would look like
<xml_element>
<request>
<transaction>
.....
</xml_element>
So you can see above that the 2 top level elements <xml_element> and <request>
are the same.
Now I use Xmlbeans to generate 2 different jars out of it -
type1.xsd has the following document object -
com.company.type.one.XmlElementDocument
type2.xsd has the following document object -
com.company.type.two.XmlElementDocument
Kindly note the packages are different and so are fully qualified classnames.
Also they are in 2 different jars type1.jar and type2.jar
Now when I load my Application and try to use
com.company.type.one.XmlElementDocument.Factory.parse("somexml") - where
"somexml" is actually of type type1.xsd it errors out telling xml not of type
<xml_element> - shocking!! it works fine standalone. But when I put both jars
together it errors out!!
if i remove type2.jar from the application it works fine happily again.
Ideally since the package names are different shouldnt the 2 XmlElementDocument
s be identifiable separately.. after all that's why java is so good with fully
qualified classnames.
Please suggest if you have faced similar issue.
thanks in advance.
Soumya