Hi Emmanuel,
I was wondering if this really comply with the XML specs, since (if I remember well) when you define A.id and B.id as ID attributes (whether in a DTD or XML Schema) then your example will not be validated because XML does not allow two IDs to have the same value in the same document
Am I wrong?
Claude
> -----Original Message-----
> From: Emmanuel Bourg [mailto:[EMAIL PROTECTED]]
> Sent: 28 November 2002 16:51
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] Should IDResolver.resolve be class aware ?
>
>
> Currently the resolve method in the IDResolver interface only accepts
> one string as argument, assuming all objets unmarshalled will have
> distinct IDREFs, but 2 objects of 2 different classes could have the
> same id, for example :
>
> <root>
> <a id="123"/>
> <b id="123"/>
>
> <c id="456">
> <a>123</a>
> </c>
> </root>
>
> Unmarshalling this document will lead to an IllegalArgumentException,
> because the reference 123 used in the C element will be
> resolved to the
> instance of B instead of the instance of A as expected.
>
> I suggest adding a java.lang.Class argument to the IDResolver.resolve
> method, that would fix this issue. I can provide a patch if needed.
>
> Emmanuel Bourg
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
__________________________________________________________________________
· This email and any files transmitted with it are CONFIDENTIAL and intended
solely for the use of the individual or entity to which they are addressed.
· Any unauthorized copying, disclosure, or distribution of the material within
this email is strictly forbidden.
· Any views or opinions presented within this e-mail are solely those of the
author and do not necessarily represent those of Odyssey Asset Management
Systems SA unless otherwise specifically stated.
· An electronic message is not binding on its sender. Any message referring to
a binding engagement must be confirmed in writing and duly signed.
· If you have received this email in error, please notify the sender immediately
and delete the original.
