users@jaxb.java.net

Re: Class generation and <xsd:include>

From: Franklin, Brian <brian.franklin_at_ciraden.com>
Date: Tue, 22 Apr 2003 16:25:14 -0400

I just noticed the subject line. You would also need to use <xsd:import>
instead of <xsd:include>.

Brian

-----Original Message-----
From: Doug Holmes [mailto:dholme_at_ACXIOM.COM]
Sent: Tuesday, April 22, 2003 3:38 PM
To: JAXB-INTEREST_at_JAVA.SUN.COM
Subject: Re: Class generation and <xsd:include>


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