users@jaxb.java.net

Re: xjc and schema imports

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 02 Jan 2007 12:27:29 -0800

Eric Crampton wrote:
> Hi all,
>
> Let's say I have two schemas. a.xsd is standalone with no imports.
> b.xsd imports a.xsd. I'd like to be able to run a.xsd through xjc and
> create a standalone jar file which only has the types from a.xsd.
> Then, at a later time, I'd like to run b.xsd through xjc and have it
> only generate the source for the types in b.xsd.
>
> If I only want to use types from a.xsd, I only need a.jar. If I want
> to use types from b.xsd, I'd need both a.jar and b.jar.
>
> This is possible in Apache XMLBeans by putting the jar containing the
> other types on the classpath for scomp, the XMLBeans equivalent of
> xjc.
>
> Is this possible in JAXB2?

Yes. You'd need JAXB 2.1. See
http://weblogs.java.net/blog/kohsuke/archive/2006/09/separate_compil.html


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com