This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes XML and Related Technologies and the fly likes JaxB : Using Same Package For Two XSDs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JaxB : Using Same Package For Two XSDs " Watch "JaxB : Using Same Package For Two XSDs " New topic
Author

JaxB : Using Same Package For Two XSDs

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 629
Howdy,

-- I have one parent xsd say Parent.xsd and one child xsd, say child.xsd
-- Now I have to import (not extend) Parent.xsd in child.xsd, so that i dont have to define some common tags those are in parent.xsd and use them directly in child.xsd
-- After doing the syntax part, I generated java objects using XJC tool of Jaxb.

Problem:-

Now if i provide same package for both xsd,then the ObjectFactory class is of the later xsd,so I have to give different package for both xsds
problem with that is, even though i don't have to define the common tags in child.xsd, the jaxb classes created for common classes are different due to different package, so at run time i cannot simply assign object of parent to child and vice versa.

any solution to this problem ?

-P


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JaxB : Using Same Package For Two XSDs