File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Different Schemas using Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Different Schemas using" Watch "Different Schemas using" New topic

Different Schemas using

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 642

I have mutiple schemas and I want to genereate java classes in different package for each schema using plugin, anyone knows how to do this?


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 642
Okay,resolved it with help of God (google ), used annotation in following way ..just incase some one stumbles here to find solution..

since i had 3 xsd, initially i got following error

Multiple <schemaBindings> are defined for the target namespace ""

Reason for this error is cause none of my xsd had explicit name space defined, so all of those were in default namespace..

Rajesh Khullar

Joined: Apr 27, 2011
Posts: 1
Hi Praful,
I also have XSD with default targetNamespace and getting the same error as you.

Would you mind giving me bit more information how did you solve your issue ?

Did you put <xsd:annotation> (as you specified) in each of the schema which had default targetnamespace?

Please advise.
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 632
>I also have XSD with default targetNamespace...
"defaut targetNamespace"? There is no such term as default targetNamespace. If you mean there isn't targetNamespace attribute in the schema, it means only the instance element is not namespace-qualified. The instance element may well be in null namespace, but in the realm of schema language construction, things can still be influenced by the elementFormDefault or attributeFormDefault setting...

If your schema defining the null namespace vocabulary is dispersed throughout different files, you should have xs:include element(s) in some of them. If the one having the xs:include capable of tracing out the complete schema therefrom, you can choose that as your selected (targetted) xsd, and you can put the annotation there, or preferrably make out an jxb file with jxb:bindings node attribute pointing to /xs:schema and schemaLocation attribute pointing to that particular xsd. Like this.

But definitely not in every one of your xsd files!!!
I agree. Here's the link:
subject: Different Schemas using
It's not a secret anymore!