I haven't experienced the problem you describe with XML::Diff. The problem I have experienced is that the output is overly verbose. E.g., if you just change a few attributes, then the output is straight forward. But if you insert or delete a node, then you get a lot of node "updates" and "moves" along with the inserts or deletes (i.e. the changes are not optimal/minimal). But from what I've seen, you do get an accurate "patch" that will change the old file into the new file (which is what it says it does).
XML::SemanticDiff does what it says, and seems to give a simpler set of changes for simple inserts and deletes of nodes. It's not meant to generate a patch like XML::Diff does, though you might be able to make one with a custom handler. There's an example of how to use the module in the docs. However, the pod for the docs appears to be broken right now (for me on 5.10 and on CPAN), so you may have to look in the source code for the docs. If you, e.g., delete an element with attributes, and you want a full description of the element and the attributes, you'll have to use the custom diff handler interface to get at those attributes. The basic default handler does work as advertised in the docs though.
In reply to Re: XML diff
by runrig
in thread XML diff
by goldberg1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |