[xsd-users] ID/IDREF problem

Mathew Benson mathew.benson at gmail.com
Mon Mar 10 12:19:14 EDT 2014


Thanks for the help.  I don't want to waste your time, so I'm trying to
verify that the object model is not copied anywhere in my code or the
framework I'm using.  I can't see how the underlying framework (not xsd
generated code) would copy just a fragment of the object model, but it is
possible the framework is copying the entire object I created and
unmarshalled.  Could that cause this problem?  What if the copy constructor
was not overridden in the derived class?  Also, why would this work when I
move the ID and IDREF elements from the <choice> block to a <sequence>
block?


On Mon, Mar 10, 2014 at 1:13 AM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> Hi Mathew,
>
> Mathew Benson <mathew.benson at gmail.com> writes:
>
> > What am I doing wrong?
>
> If the schema validates correctly, then that means you have a
> valid ID-IDREF link. The problem is most likely a copy of the
> object model fragment that you are making while getting to the
> IDREF element. If you make a copy of the object model fragment,
> it becomes independant of the whole model and does not contain
> the ID element. Make sure you are using references when accessing
> the data. If not sure, show us the code that you have from parsing
> the object model to where you dereference IDREF.
>
> Boris
>


More information about the xsd-users mailing list