users@jaxb.java.net

Re: follow-up GML conflicting when binding SensorML schema

From: Peizhao Hu <peizhao_at_itee.uq.edu.au>
Date: Thu, 19 Apr 2007 00:57:12 +1000

Hi,

I understand the problem now.

Abstract elements are declared in GML as "_ElementName", concrete elements as "ElementName".
As a Java class name can not start with '_', the binding compiler mapps the name of the abstract
element "_ElementName" to "ElementName". Therefore, there will be a collision when the concrete
element is also bound to a class named "ElementName".

so how do I use XSLT to transform all abstract elements into some thing
different?

regards;

Peizhao



Peizhao Hu wrote:
> Hi,
>
> regarding to these errors:
> phu_at_phu-mac:~/programming/SensorML_examples/SensorMLV1.0/sweCommon/1.0.0
> $ xjc.sh positionTypes.xsd
> parsing a schema...
> compiling a schema...
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 1462 of
> http://schemas.opengis.net/gml/3.1.1/base/geometryPrimitives.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 1516 of
> http://schemas.opengis.net/gml/3.1.1/base/geometryPrimitives.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 201 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 220 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 283 of
> http://schemas.opengis.net/gml/3.1.1/base/geometryBasic0d1d.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 13 of
> http://schemas.opengis.net/gml/3.1.1/base/geometryPrimitives.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 36 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 51 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 169 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 150 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 293 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 312 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 73 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 92 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 86 of
> http://schemas.opengis.net/gml/3.1.1/base/geometryBasic2d.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 1084 of
> http://schemas.opengis.net/gml/3.1.1/base/geometryPrimitives.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 95 of http://schemas.opengis.net/gml/3.1.1/base/feature.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 111 of http://schemas.opengis.net/gml/3.1.1/base/feature.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 921 of
> http://schemas.opengis.net/gml/3.1.1/base/geometryPrimitives.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 14 of
> http://schemas.opengis.net/gml/3.1.1/base/geometryBasic2d.xsd
>
> [ERROR] Two declarations cause a collision in the ObjectFactory class.
> line 252 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> [ERROR] (Related to above error) This is the other declaration.
> line 271 of http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd
>
> Failed to produce code.
> phu_at_phu-mac:~/programming/SensorML_examples/SensorMLV1.0/sweCommon/1.0.0
> $
>
>
> I have a few questions and hope someone can ask some of them.
> 1. what do "Two declarations cause a collision in the ObjectFactory
> class" and "(Related to above error) This is the other declaration."
> mean?
> 2. do they really mean name collision with XML elements? I suspect
> these errors occur whenever there is a substitutionGroup, like
> <element name="_Solid" type="gml:AbstractSolidType" abstract="true"
> substitutionGroup="gml:_GeometricPrimitive">
>
>
>
> Comments about the error from SensorML community:
>
> I believe these are related to JAXB getting confused be declarations of
> XML elements whose name differs only by lexical case. XML names are
> case-sensitive (this is specifically stated in the *XML* spec from W3C).
> You have to configure your data binding environment to respect this.
>
>
>
>
>