Details
Description
Would like to offer a third marshaller, ReferenceByPathMarshaller, to sit as best of both worlds between TreeMarshaller and ReferenceByIdMarshaller.
------------
TreeMarshaller:
- clean XML
- does not support duplicate or circular references
<people>
<person>
<car>
<make>Ford</make>
</car>
</person>
<person>
<car>
<make>Ford</make>
</car>
</person>
</people>
------------
ReferenceByIdMarshaller:
- adds bloat of IDs to XML
- supports duplicate and circular references (full object graphs)
<people id="1">
<person id="2">
<car id="3">
<make>Ford</make>
</car>
</person>
<person id="4">
<car reference="3"/>
</person>
</people>
------------
ReferenceByPathMarshaller
- clean XML... only writes references when needed
- supports duplicate and circular references (full object graphs)
<people>
<person>
<car>
<make>Ford</make>
</car>
</person>
<person>
<car path="../person[1]/car"/>
</person>
</people>
Done