Windows – 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.

Solution:

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