users@jaxb.java.net

Re: Using Custom bindings to generate small classes for big schemas

From: Scott Ziegler <zieg_at_bea.com>
Date: Wed, 26 Feb 2003 14:17:31 -0800

On Wed, 2003-02-26 at 10:52, Ryan Shoemaker - JavaSoft East wrote:
> Katz Guy wrote:
> >
> > Hi;
> >
> > Reading the jaxb user guide I couldn?t understand if I can acheve the
> > following. I would appreciate any help.
> >
> > basically , In my project i have huge huge xml schemas and would like to
> > generate a small class(or a number of small classes) per schema which
> > represent a fragment of that schema.
> >
...
>
> Guy,
>
> The binding customizations allow you change the default bindings generated
> by the compiler, but there is no way to limit the generated interfaces to
> specific fragments of the schema as you described. There may be some
> extremely limited use cases where you might be able to force JAXB to behave
> this way, but in general this is not possible. I'll think about it some more,
> but in the mean-time, I'd be interested to know if anyone else on the list
> has any thoughts...

>>From the Non-Goals section of the spec:

"If there is only a partial binding of all non-optional XML elements
reachable from an XML element, it would no longer be possible to
roundtrip the data back to its original XML content form."

So perhaps JAXB is not the best approach for your needs.

--Scott