Section 6.12 of the JAXB spec. describes some ambiguities with respect to annotation elements of local attribute and particle references to global declarations which use the "ref" attribute. The spec states that the position taken by JAXB assumes annotation references are valid in all 3 cases described and the association of the annotation to the referencing local attribute use or particle.
And that's the way it worked for the beta version of JAXB.
But it seems not to work that way now in JAXB 1.0. Below is an example which xjc no longer parses. I get this error:
Compiling file:/C:/Src/Java/XTests/AnnotatedElementRef/testroot.xsd
[ERROR] Specified property customization is not used.
line 18 of testroot.xsd
Is there any workaround for this?
-----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- AnnotatedElementRef -->
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema"
xmlns:jxb="
http://java.sun.com/xml/ns/jaxb"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
jxb:version="1.0">
<xs:element name="XtestRoot">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstElement" type="xs:string"/>
<xs:element ref="GlobalElement" maxOccurs="unbounded">
<xs:annotation><xs:appinfo>
<jxb:property name="OtherElementList"/>
</xs:appinfo></xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GlobalElement" type="xs:string" />
</xs:schema>