XML: How to reprepresent objects with multiple occurences?
- by savras
hi, i need to save objects that can occur multiple times.
each object is marked with unique identifier. when it is serialized first time all its properties are written. after that only references are used.
<actionHistory>
<add>
<figure id="1" xsi:type="point">
<position x="1" y="2" />
</figure>
</add>
<change>
<target ref="1" />
<property>x</property>
<value>3</value>
</change>
</actionHistory>
element 'target' only references to point saved before, but it can contain definition of new figure as well. there is also figure class hierarchy involved.
is there any way to express it using xml-schema? any suggestions how to improve code above will be also appreciated.