I'm looking for an efficient way to compare and get differences between two XML-based parse trees.
What would you suggest to be the best way to store those differences? I would have done this:
XML A:
<w:p>
<w:pPr>
<w:spacing w:after="1"/>
</w:pPr>
<w:r>
<w:t>World</w:t>
</w:r>
</w:p>
XML B:
<w:p>
<w:pPr>
<w:spacing w:after="1"/>
</w:pPr>
<w:r>
<w:t>ASDF</w:t>
</w:r>
</w:p>
The algorithm determines that "World" has changed to "ASDF" and then stores:
div: <w:p><w:r><w:t>World</w:t> -> <w:p><w:r><w:t>ASDF</w:t>
Is this enough to cover all cases that might occur?
Does anybody know of a good way to do that? Any help would really be appreciated!