Line-length-tolerant XML diff

I've looked at the answers to this question, and unfortunately none of them has helped me so far.

Not to beat about the bush, the second edition of C# in Depth is now in copy edit. I want to be able to see what the copy editor's done really easily, so I can reject or accept his changes.

We're using a modified form of docbook, but I'm happy enough looking at the raw XML source. All fine so far - except that when the copy editor makes a change, that can change the line wrapping. So something that used to read:

<para>Foo bar baz
 second line</para>

now reads

<para>Foo bar grontle
 baz second line</para>

Now the real change here is the insertion of "grontle". I don't care that "baz" has moved from the first line to the second line, but all the diff tools I've seen do.

I realise that one option would be to reformat the whole document (or possibly just whole paragraphs) into single lines... but that's then really hard to read, because diff tools don't wrap when they're displaying.

I'm sure I can manage with the tools I've got, but if anyone knows of anything better, I'd be really glad to hear about it. I suspect my publishers would too.

(I've included the Windows tag here because I'd really need it to be available on Windows. I'd like to hear about any non-Windows software too, but only in case I could help to build it on Windows.


Looks like SourceGear DiffMerge will give you this, with its ruleset support for XML (and lots of other languages). I'm not sure if it will fix all your problems, because the example is of course a simplification of the actual program. I tried slightly more complex changes, and those seem to work fine too.

See the sample below for the diff you described

simple diff


My solution is with beyond compare. ( a much more powerfull tool )

So we start by seeing the problem.

enter image description here

BC has a special XML parsing role : ( it has already XML role , but not with pre-analysis - which is Sorted and Tidied)

enter image description here

so we go to http://www.scootersoftware.com/download.php?zz=kb_moreformats_alt

enter image description here

and now -

enter image description here

hope you'll use it for next edition of C# in depth

p.s. if the text in pictures is too small, just click on the picture to load the original ones.


I'm the author of an XML diff tool (commercial software) that should do the job (and some more features). There is a test version (which is limited to Xml files of 100 KBs max.) for download here:

http://xmldifftool.com/download_en.html

A short introduction is also available here:

http://xmldifftool.com/xtcmanual_en.html