users@jaxb.java.net

Re: Imported GML schema

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 14 Feb 2005 08:46:34 -0800

Isabelle KERVELLA wrote:
> Ryan, Kohsuke,
>
> Thanks for reply.
>
> The document of GML 2.1.2 specifications mentions that all examples
> (city.xsd) have been validated using the following suite of parsers:
> · Apache Xerces (v2.0 beta 4)
> · Altova XML Spy (v4.2)
> · Microsoft MSXML (v4.0)
> And the schema feature.xsd and geometry.xsd are parsed by XAmple (using
> Xerces).

The latest Apache Xerces is around v2.6, and I have so many bad
experiences with the spec conformance of XMLSpy. So that list doesn't
impress me very much.


> For you, these schemas contain errors ?

Yes. I get the following errors from Xerces in J2SE5.0:

[ERROR] rcase-RecurseLax.2: There is not a complete functional mapping
between the particles.
   line 297 of
file:/C:/kohsuke/Sun/JAXB/jaxb-unit/individual/gml/geometry.xsd

[ERROR] derivation-ok-restriction.5.4.2: Error for type
'MultiPolygonType'. The particle of the type is not a valid restriction
of the particle of the base.
   line 297 of
file:/C:/kohsuke/Sun/JAXB/jaxb-unit/individual/gml/geometry.xsd

[ERROR] rcase-RecurseLax.2: There is not a complete functional mapping
between the particles.
   line 280 of
file:/C:/kohsuke/Sun/JAXB/jaxb-unit/individual/gml/geometry.xsd

[ERROR] derivation-ok-restriction.5.4.2: Error for type
'MultiLineStringType'. The particle of the type is not a valid
restriction of the particle of the base.
   line 280 of
file:/C:/kohsuke/Sun/JAXB/jaxb-unit/individual/gml/geometry.xsd

[ERROR] rcase-RecurseLax.2: There is not a complete functional mapping
between the particles.
   line 263 of
file:/C:/kohsuke/Sun/JAXB/jaxb-unit/individual/gml/geometry.xsd

[ERROR] derivation-ok-restriction.5.4.2: Error for type
'MultiPointType'. The particle of the type is not a valid restriction
of the particle of the base.
   line 263 of
file:/C:/kohsuke/Sun/JAXB/jaxb-unit/individual/gml/geometry.xsd

Upcon closer look in the actual schema, I have to admit that I couldn't
understand why this is an error. But I'm willing to trust Xerces
developers on the knowledge of XML Schema.

As Ryan suggested, the "-nv" is the way to shut off Xerces.

> Else, when I try the "-nv" arg to my build.xml, the error is as follows:
>
> [xjc] [ERROR] A class/interface with the same name
> "org.example.GeometryProperty" is already in use. Use a class
> customization to resolve this conflict.
> [xjc] line 22 of feature.xsd
> [xjc] [ERROR] (Relevant to above error) another "GeometryProperty" is
> generated from here.
> [xjc] line 23 of feature.xsd
> [xjc] [ERROR] the property "Feature" is empty and contains no value
> [xjc] line 130 of feature.xsd
> [xjc] failure in the XJC task. Use the Ant -verbose switch for more details

Those are the name conflit errors, and there's a sample bundled in the
distribution that shows you how to use <jaxb:class> customizatino or a
nameXmlTransform customization to resolve this.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com