Three-Way File Comparison and Difference Merging


Manually comparing versions of a long XML Schema or document to find any differences would be a tedious and error-prone task. XMLSpy has long featured file comparison with highlighted differences in side-by-side windows with merging in either direction. And of course, DiffDog is the go-to comparison utility for text, source code, XML, JSON, and Word documents. Now both XMLSpy and DiffDog support three-way file comparison and difference merging.

Three-way file comparison is especially relevant for files managed in any source control system where two users may have started from the same source file and made different edits that need to be reconciled.

Three-Way File Comparison in XMLSpy

To open a three-way file comparison in XMLSpy, simply choose Compare Open File With . . . from the Tools menu and select the files:

Choosing files for a three-way file comparison in XMLSpy

 

The files may already be open in other windows, or you can load them from anywhere on your workstation, network, or even via URL. The files you specify will open side-by-side with highlighted differences.

Three-way file comparison in XMLSpy

Note that the comparison is XML-aware and only differences that matter in an XML context are flagged. In the comparison above, the file on the far right does not contain line endings or tab characters. Since those are meaningless in an XML document, they are not flagged.

You can select any difference and automatically merge from the Compare Differences menu, as seen below:

Difference merging during three-way file comparison in XMLSpy

For the selected difference shown here, some options in the Compare Files pane are grayed out because the files in the center and right windows agree.

When you finish comparing and merging differences, click the Done button to end the comparison session. All three files remain open in separate editing windows so you can use Save or Save As to preserve the desired versions.

Three-Way File Comparison in DiffDog

Open a three-way file comparison in DiffDog either from the File menu option, or by clicking the toolbar icon shown here:

Toolbar icon for three-way file comparison in DiffDog

Three file windows open side-by-side, each with a set of file navigation tools at the top. In the example below, a JSON common ancestor file is open in the center window, with variations on the left and right.

Three-way file comparison in DiffDog

A special toolbar only displayed during a 3-way file comparison lets you easily merge differences or navigate between them.

Special toolbar for 3-way file comparison in DiffDog

 

The last button on the toolbar even lets you swap the document order.

As with XMLSpy, when your merges are complete, the Save and Save As . . . tools for each document pane let you preserve your changes.

XMLSpy is the world’s best-selling XML editor for modeling, editing, transforming, and debugging XML and related technologies. DiffDog is the unique XML-aware diff / merge utility that lets you compare and merge text or source code files, XML or JSON files, and Word documents, as well as synchronize directories, database schemas and content.

Both XMLSpy and DiffDog are included in the Altova MissionKit, available for a fully-functional free evaluation at the Altova Download Center. Try it yourself for all your three-way file comparison needs!

Tags: , , ,
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *