users@jaxb.java.net

Re: Generate java packages to reflect structure of schema tree?

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Sun, 4 Nov 2007 19:45:57 +0100

Hi.

> > I believe you're dealing with OGC schemas, am I right? If so, I've
> > compiled half of their schema stack with JAXB 1. Let me know, I'll
> > post notes on my experience then.
>
> That is correct. Thanks for sharing.

Okay.

In one of the projects we were using some OGC specifications (WMS, OGC
View Context and CSW). Therefore I've desided to compile OGC schemas
using JAXB (JAXB 1 then).

I met several problems:

* OGC Schemas are defined in a number of versions.
* OGC Schemas have a lot of inter-dependencies.
* OGC Schemas are sometimes quite large.
* OGC Schemas are sometimes errorneous.

By the way, the schemas we're discussing are these here:

http://schemas.opengis.net/SCHEMAS_OPENGIS_NET.zip

Compiling everything at once was not an option since schemas were too
big. Moreover sometimes corrections and extensions were needed to be
introduced. I've structured the OGC schemas project in two levels:
first level for languages and second for individual versions of
languages. I've implemented a "brute-force" separate compilation then
(it's called episodic or separate compilation in JAXB 2, but it did
not existed in JAXB 1). In each of the modules I've compiled
individual language/version - and the just deleted classes from
external schemas.

So finally I got a number of Maven jar modules (one per
language/version), depending on each other, like "context" module
depends on "sld" modules.
I've also written some adapting routines which upgrade objects to
newer versions, like WMS 1.1.0 and WMS 1.1.1 were all upgraded to WMS
1.3.0.

In JAXB 2 I think a similar structuring would make sense - first level
for languages, second level for versions. Catalog files and this new
great feature of episodic compilation would allow compiling each
schema separately.

For those inretested I could share the OGC schema project which I
implemented in the past. As I said, it's done with JAXB 1. Right now
I'd do it a bit differently, I think, taking advantage of new JAXB 2
features.

Bye.
/lexi