I've been trying to use a third party's XSD with XMLBeans (specifically
something called AIXM - http://www.aixm.aero/).

I'm unsure if the problem lies with XMLBeans or with the schema.  I was able
to replicate the problem with this test XSD:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
           elementFormDefault="qualified"
           attributeFormDefault="unqualified">

  <xs:element name="ArrestingGearTimeSlice"
type="ArrestingGearTimeSliceType">
  </xs:element>

  <xs:complexType name="ArrestingGearTimeSliceType">
    <xs:complexContent>
      <xs:extension base="AbstractAIXMTimeSliceBaseType">
        <xs:sequence>
          <xs:group ref="ArrestingGearPropertyGroup"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:group name="ArrestingGearPropertyGroup">
    <xs:sequence>
      <xs:element name="description" type="xs:string" nillable="true"
minOccurs="0"/>
    </xs:sequence>
  </xs:group>

  <xs:complexType name="AbstractAIXMTimeSliceBaseType" abstract="true">
    <xs:complexContent>
      <xs:restriction base="AbstractGMLType">
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="AbstractGMLType" abstract="true">
    <xs:sequence>
      <xs:group ref="StandardObjectProperties"/>
    </xs:sequence>
  </xs:complexType>

  <xs:group name="StandardObjectProperties">
    <xs:sequence>
      <xs:element ref="description" minOccurs="0"/>
    </xs:sequence>
  </xs:group>

  <xs:element name="description" type="xs:int"/>

</xs:schema>

This is my output from scomp:

[EMAIL PROTECTED]:~/Desktop$ ~/java/xmlbeans-2.3.0/bin/scomp test.xsd
Time to build schema type system: 2.25 seconds
Time to generate code: 0.621 seconds
/tmp/xbean41513.d/src/noNamespace/ArrestingGearTimeSliceType.java:29:
xgetDescription() in noNamespace.ArrestingGearTimeSliceType clashes with
xgetDescription() in noNamespace.AbstractGMLType; attempting to use
incompatible return type
found   : org.apache.xmlbeans.XmlString
required: org.apache.xmlbeans.XmlInt
    org.apache.xmlbeans.XmlString xgetDescription();
                                  ^
/tmp/xbean41513.d/src/noNamespace/ArrestingGearTimeSliceType.java:24:
getDescription() in noNamespace.ArrestingGearTimeSliceType clashes with
getDescription() in noNamespace.AbstractGMLType; attempting to use
incompatible return type
found   : java.lang.String
required: int
    java.lang.String getDescription();
                     ^
/tmp/xbean41513.d/src/noNamespace/impl/ArrestingGearTimeSliceTypeImpl.java:47:
xgetDescription() in noNamespace.impl.ArrestingGearTimeSliceTypeImpl cannot
implement xgetDescription() in noNamespace.AbstractGMLType; attempting to
use incompatible return type
found   : org.apache.xmlbeans.XmlString
required: org.apache.xmlbeans.XmlInt
    public org.apache.xmlbeans.XmlString xgetDescription()
                                         ^
/tmp/xbean41513.d/src/noNamespace/impl/ArrestingGearTimeSliceTypeImpl.java:29:
getDescription() in noNamespace.impl.ArrestingGearTimeSliceTypeImpl cannot
implement getDescription() in noNamespace.AbstractGMLType; attempting to use
incompatible return type
found   : java.lang.String
required: int
    public java.lang.String getDescription()
                            ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors

BUILD FAILED
[EMAIL PROTECTED]:~/Desktop$

It appears as if the schema is violating the unique particle attribution
rule, but I'm not sure because of the restriction tag.  If I do not use the
group tag, I get the unique particle attribution rule.

Got any thoughts on what's going on?  Any thoughts on workarounds or hacks?

Reply via email to