jaxb - generate classes from single schema in different packages depending on namespace

StackOverflow https://stackoverflow.com/questions/3665140

  •  01-10-2019
  •  | 
  •  

Question

My requirement is that I have a very big schema and it has many different tags with different namespaces. I want to generate classes from that schema into different packages and I want this thing to be bases on namespace i.e. I want classes corresponding to tags in one namespace to be in one package and classes corresponding to tags in other namespace to be present in different name space. I want an ant task to perform the above functionality

Was it helpful?

Solution

Actually, this is normal JAXB behaviour: XJC derives packages from namespace URIs (http://www.acme.com/foo -> com.acme.foo).

Here's a sample Ant "Purchase Order" project:

http://confluence.highsource.org/display/J2B/Downloads

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top