eclipse-ee4j / jaxb-ri

Jaxb RI
https://eclipse-ee4j.github.io/jaxb-ri/
BSD 3-Clause "New" or "Revised" License
198 stars 109 forks source link

Adapting reference type #1137

Open Tomas-Kraus opened 6 years ago

Tomas-Kraus commented 6 years ago

I am dealing with an xsd that basically extends IDREF type in order to reference elements throughout the xml. I did post my problem on stackoverflow but so far no luck: https://stackoverflow.com/questions/45823840/how-to-unmarshal-and-adapt-a-reference-type.

Here is an example of such xsd:

<xs:complexType name="REF_T">
    <xs:attribute name="IDREF" type="xs:string" use="required" />
</xs:complexType>

<xs:complexType name="USER_T">
    <xs:complexContent>
        <xs:extension base="BASE_T">
            <xs:sequence>
                <xs:element name="ROLE-REF" type="REF_T"/>
            </xs:sequence>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>

<xs:complexType name="ROLE_T">
    <xs:attribute name="ID" type="xs:ID" use="required" />
    ...
</xs:complexType>

I am able to generate the code the way I want it using an xjb file, the code compiles and runs without crashing. But most of my tests are not passing. While debugging, I saw that once the patchers are again called in unmarshalContext.endDocument the newly found idrefs are not unmarshaled.

Tomas-Kraus commented 5 years ago