Get your CodeRanch badge!*
The moose likes XML and Related Technologies and the fly likes Different Schemas using com.sun.tools.xjc.maven2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Different Schemas using com.sun.tools.xjc.maven2" Watch "Different Schemas using com.sun.tools.xjc.maven2" New topic
Author

Different Schemas using com.sun.tools.xjc.maven2

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 613
Hi,

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

-P


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

Joined: Feb 10, 2001
Posts: 613
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..

-P
Rajesh Khullar
Greenhorn

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.
Thanks
Rajesh
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 463
    
    2
>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: http://aspose.com/file-tools
 
subject: Different Schemas using com.sun.tools.xjc.maven2
 
Similar Threads
XML Schema
question on select
Validating against multiple schemas
Schema validation with Xerces 1.4
Maven build error