Optimization Techniques
The techniques below are discussed in terms of SVG, but can evidently be used with any other schema.
Handling SVG elements where order is not important
DeltaXML provides the ability to handle specified elements as orderless, so that a change in the order of child elements is not considered significant and is not recorded as a change. This is critical for some SVG elements. DeltaXML can handle arbitrary nesting or ordered and orderless elements, so you get fine control over whether children are considered sets or lists.
Using id attributes to improve the quality of change identification
When computing differences DeltaXML first performs an "alignment" step, to establish which elements are to be compared. Where id attributes are provided to identify specific elements these can be used as keys by DeltaXML to ensure that the same elements are matched up in the two files. So, for example, where only the color of a <g> has been changed, instead of showing a deleted and added <g> element, DeltaXML will identify the color change. Keys can be derived from an attribute, from textual (PCDATA) content, from child elements or from any combination thereof.
Granularity of changes
Due to the structure of SVG, it would not be possible to identify a change to a single point in a 'd' attribute, for example. Rather, the old and new values will be identified. In this case, it is probably preferable to show the change at the level of the <path> element. Thus for any <path> element that has been changed, an old and new path element can be generated and each is animated. Again, this is easily achieved in XSLT using the full context delta.
More general optimization documentation is also available, please see our Resource Library.