[xsd-users] ID/IDREF problem

Mathew Benson mathew.benson at gmail.com
Mon Mar 10 18:39:12 EDT 2014


I figured it out.  When I moved it from the <choice> to <sequence>, that
also changed how I referenced the object, so that was a red herring.  The
problem was I casted all my dereferenced iterators as objects, not as
references to objects.  I was running code in code space, but the data
space was incorrect so all my member attributes were messed up.  I would
have found it faster if it had crashed while traversing the tree.  Once I
put my code back together again, it should all work.  Thanks.


On Mon, Mar 10, 2014 at 11:19 AM, Mathew Benson <mathew.benson at gmail.com>wrote:

> 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