users@jaxb.java.net

Re: Class generation and <xsd:include>

From: Doug Holmes <dholme_at_acxiom.com>
Date: Tue, 22 Apr 2003 13:38:09 -0600

We've been using JAXB 1.0 and are pretty happy with it. I have one question about how imported schemas are generated, because we would like to share some common elements across many schemas.

Since each schema that includes these common elements creates JAXB objects for them in a different package, I can't have common code to pack/unpack the common elements.

The only solution I can think of is to put the same interface on the various versions of the same object in the different packages, but JAXB 1.0 seems to preclude adding specific interfaces to specific generated objects.

Just so I understand what my tradeoffs are, I was wondering what the "good reason" (see below) is that these common schema definitions are duplicated?



On Tue, 21 Jan 2003 13:30:38 -0800, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM> wrote:

>The package is per-namespace basis. IOW, if two components are in the
>same namespace (regardless of the source .XSD file it is defined), they
>will end up in the same package.
>
>It's not clear to me whether your child schemas are all belong to a
>difference target namespace URI or the same namespace URI.
>
>If they are different, you end up receiving duplicates of
>common_types.xsd in every package (for a good reason, BTW),
>
>If they are the same, all the components from all your children schemas will
>be generated into the same package.
>
>
>regards,
>--
>Kohsuke KAWAGUCHI 408-276-7063 (x17063)
>Sun Microsystems kohsuke.kawaguchi_at_sun.com