users@jaxb.java.net

attributeGroup ref and annotation

From: Shailender <shailender.bathula_at_AIRNZ.CO.NZ>
Date: Sun, 02 Mar 2003 17:40:20 -0700

I am trying to generate classes for the following schema using
JAXB 1.0 RI "xjc.bat" and J2SDK1.4 It fails to parse the schema because
of the annotation element within the attributeGroup ref element.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="MyElement" type="MyType"/>

  <xs:complexType name="MyType">
    <xs:attributeGroup ref="MyAttributeGroup">
      <xs:annotation>
 <xs:documentation>My attribute group</xs:documentation>
      </xs:annotation>
    </xs:attributeGroup>
  </xs:complexType>

  <xs:attributeGroup name="MyAttributeGroup">
    <xs:attribute name="MyAttribute" use="required"/>
  </xs:attributeGroup>
</xs:schema>

D:\>xjc Test.xsd
parsing a schema...
Failed to parse a schema.

It works, if I remove the annotation element from the attribuetGroup ref element, like below:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="MyElement" type="MyType"/>

  <xs:complexType name="MyType">
    <xs:attributeGroup ref="MyAttributeGroup"/>
  </xs:complexType>

  <xs:attributeGroup name="MyAttributeGroup">
    <xs:attribute name="MyAttribute" use="required"/>
  </xs:attributeGroup>
</xs:schema>

Is this a bug in the RI or a limitation of JAXB that I am not aware of?

Thanks,
Shailender