Loren Halvorson's Blog

If your only tool is a hammer...

Comparing XML Files with Beyond Compare 3...Brilliant

I bought a new laptop and was loading it with the tools I use every day. When it came to installing one of my favorites, Beyond Compare 2, I thought I'd check the Scooter web site to see if I had the latest version. I was happy to see they now had a version 3 with plenty of new features. I immediately reached for my credit card to buy a license. Folks, this is honestly one of the tools I don't even hesitate paying for...it's that good, and that invaluable. I don't work for them, I'm just a very happy customer.

The base tool itself is great, but I was really thrilled when I followed the link on the Download page to Additional file format downloads for version 3.  There I found something I've been looking for years...and in fact a while ago had written a plug-in for BC2 to do...the ability to compare Tidied XML.

How many times have you tried to compare two dense XML files to find out their differences only to be faced with a block of differences that looks like this:

Beyond Compare notices that there are differences in there somewhere, but can't really show you where with any precision. Further inspection is going to be needed, and forget merging selected changes over from one side to the other.

If you install the XML Tidied and XML tidied with attributes sorted file formats, you can now tell Beyond Compare to tidy up your documents, putting each attribute on its own line, so the differences stand out. You can now see exactly which attributes differ. Absolutely brilliant.

This is a fantastic feature that's already saved me a bunch of time. I see there is a similar add-in for HTML tidied files that also will come in handy.

A couple of other features in Beyond Compare that I've come to rely on over the years:

  • Beyond Compare has great "low-friction" integration with Windows Explorer. For example to compare two files, you just right click on one file and choose "Select Left Side For Compare", then right click on the other file and say "Compare to {file...}".  This works for folders too.
  • Beyond Compare has great FTP integration. I use it to deploy changed files to FTP sites very painlessly.

I also see it supports doing 3-way merging from most version control systems. I haven't tried this yet, but I'm going to see how hard it is to plug into TFS.  If anyone has pointers on how to set this up, let me know.

 Update: Scooter's website shows how to set it up here

They have a 30 day trial, so if you aren't so sure, you can give it a try for a while. Highly recommended.

Comments

Derek Scot said:

Great tool.

For comparing XML files I am using ExamXML

# August 3, 2009 9:04 AM