users@jaxb.java.net

Two declarations cause a collision in the ObjectFactory class (jaxb2.0)

From: Johannes Echterhoff <Johannes.Echterhoff_at_gmx.de>
Date: Wed, 10 Aug 2005 13:53:19 +0200

Hi.

This is quite annoying: i try to compile the schemas at
http://schemas.opengeospatial.net/gml/3.1.1/base (i downloaded them so
that compilation gets faster), but i receive following errors

C:\Daten\SPS_x2j_test\with_JAXB20>java -Dxml.catalog.verbosity=999 -jar
C:/Daten/jaxb-ri-20050808/lib/jaxb-xjc.jar -d result -catalog
CustomCatalog.xml ../gml311/base
parsing a schema...
compiling a schema...
[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 300 of file:/C:/Daten/SPS_x2j_test/gml311/base/defaultStyle.xsd

[ERROR] (Related to above error) This is the other declaration.
  line 319 of file:/C:/Daten/SPS_x2j_test/gml311/base/defaultStyle.xsd

... some more errors with same reason follow.

The part of the schema that is related to the above error looks like this:

<!-- ==============================================================
      Graph Style Property
    ============================================================== -->
    <xsd:element name="graphStyle" type="gml:GraphStylePropertyType">
        <xsd:annotation>
            <xsd:documentation/>
        </xsd:annotation>
    </xsd:element>
    <!-- =========================================================== -->
    <xsd:complexType name="GraphStylePropertyType">
        <xsd:annotation>
            <xsd:documentation/>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element ref="gml:GraphStyle" minOccurs="0"/>
        </xsd:sequence>
        <xsd:attribute name="about" type="anyURI" use="optional"/>
        <xsd:attributeGroup ref="gml:AssociationAttributeGroup"/>
    </xsd:complexType>
    <!-- ==============================================================
      Graph Style
    ============================================================== -->
    <xsd:element name="GraphStyle" type="gml:GraphStyleType"
substitutionGroup="gml:_GML">
        <xsd:annotation>
            <xsd:documentation>The style descriptor for a graph
consisting of a number of features. Describes graph-specific style
attributes.</xsd:documentation>
        </xsd:annotation>
    </xsd:element>

It seems as if the declaration of "graphStyle" and "GraphStyle" as
element-names cause the problem. Is there a way to solve this problem
without changing the schemas?

Regards,
    Johannes Echterhoff