users@jaxb.java.net

Re: Use of <appinfo> with JAXB

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_sun.com>
Date: Thu, 26 Jun 2003 08:33:41 -0400

Pratt, Jerald wrote:

> The 3rd party schemas that I'm trying to use are provided by OpenGIS group
> (www.opengis.org). I'm currently using the GML v3.0.0 though I saw today
> there is an update (v3.0.1). The problems that I'm having with trying to
> compile these XML schemas with JAXB are
>
> 1) The GML (openGIS) use of <appinfo> in their schema files. I'm not sure
> exactly why JAXB has a problem but if I simply comment out the <appinfo>
> element then I get past this problem. As I provided before, the XJC error
> message from the XJC ant task is:
>
> [xjc] [ERROR] unexpected character literal
> [xjc] line 4 of basicTypes.xsd
>
> I get this for a few of the schema files but not all of them.
>

See below...

> and:
> 2) The GML schemas implement "abstract" attribute (abstract="true") on some
> of their elements. In this case, the error message that I get is:
>
> [xjc] [ERROR] unsupported schema feature: "abstract" attribute of
> <element> is not supported
> [xjc] line 38 of gmlBase.xsd
>

It looks like you are using JAXB 1.0 which prohibited the use of @abstract
on <element>. If you upgrade to JAXB 1.0.1 and run the compiler with the
-extension switch, @abstract should be allowed eventhough it isn't implemented.
It also looks like the appinfo doc problem you are seeing was a JAXB 1.0 bug,
because gmlBase.xsd compiled fine when used the 1.0.1 compiler in extension mode:

> LORAX [153] =>xjc -extension gml/gmlBase.xsd
> parsing a schema...
> compiling a schema...
> [snip]

This seems to only compile:

> gml/basicTypes.xsd
> xlink/xlinks.xsd
> gml/gmlBase.xsd

When I tried:

> LORAX [154] =>xjc -extension `find . -name *.xsd -print`

I got a ton of Xerces validation errors on the other schema files under the
gml directory - not sure what that's all about though...

--Ryan

> So my question is why do these schema files have a problem with the
> <appinfo> line and when will/might support be available for "abstract"
> attributes of elements? And, is there any other work around that I might be
> able to use given that I don't own these XML schema files?
>
> If anyone is interested in looking at the OpenGIS xml Schema files, they can
> go to www.opengis.org or let me know and I can provide them in a zip file.
>
> Jerald
>