SAXException2 with ID and IDREF
Have an XSD that declares an object with an ID and another object with an IDREF as follows:
Using JAXB, I instantiate and add two "subject" objects. The first has attribute id of "z1_id" and attribute name of "z1_name". The second has attribute id of "z2_id" and attribute name of "z2_name".
Again using JAXB, I instantiate and add one "subjectRelationship" object. It has attribute parentSubject of "z1_id" and attribute childSubject of "z2_id".
When I attempt to marshal the above, I get the following exception:
com.sun.istack.SAXException2: Object "z1_id" is found in an IDREF property but this object doesnt have an ID.
I presume that I am guilty of some misunderstanding of the ID and IDREF mechanism, but what? I cannot find any example on the web of a proper ID and IDREF implementation. Thanks.