xmldiff patch output corrupts actual XML file
Brought to you by:
rpeyron
Because of the way, you're saving file difference in
patch file output, you may actually corrupt XML file
contents of XML files that are making use of attributes
that you are using for patching.
For example:
test1.xml:
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
<?xml version="1.0"?>
<main>
<test title="Welcome !" status="inactive"/>
</main>
test2.xml:
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
<?xml version="1.0"?>
<main>
<test title="Welcome :-)" status="active"/>
</main>
When running:
xmldiff diff test1.xml test2.xml output.xml
output.xml will contain an incorrect patch from
test1.xml -> test2.xml because of the status=""
attribute, that's being overwritten by xmldiff
with its own contents.