CONFERENCE PAPER

An Improved diff3 Format for Changes and Conflicts in Tree Structures

Diff3 works surprisingly well for pretty-printed source code and similar documents. But it has frustrating limitations when used for XML or JSON or similar tree-based data formats. Can it be improved?

Improving upon the standard

This paper has been improved upon. If you would like to read the most up-to-date version, click here.

There are some pieces of software, and some formats, that are de-facto standards and have been around for decades. One of these is the diff3 format for representing changes and conflicts in text documents.

Diff3 works well for unstructured text documents that are divided into lines, but can we improve on diff3 without making it too complicated? Can the existing representation of changes and conflicts be extended to handle tree-based data? This paper seeks to answer these questions and to describe how further benefits can be enjoyed by using XML or JSON as the basis for showing conflicts and changes.

Read this conference paper to:

  • Understand how diff3 delimits the extent of changes and conflicts.
  • Review the issues of preserving the well-formed structure of XML or JSON when presenting choices in diff3.
  • Compare comparison results when using XML, JSON and the diff3 format.

An Improved diff3 Format for Changes and Conflicts in Tree Structures

Conference Paper

Diff3 works surprisingly well for pretty-printed source code and similar documents. But it has frustrating limitations when used for XML or JSON or similar tree-based data formats. Can it be improved?

By laying out comparison results for structured representations such as XML or JSON we can make them easier to process and more likely to provide well-formed or valid result.

Related Media

There is no doubt that the diff and diff3 format has established itself as a well-used de-facto standard. In our last paper on the subject, we suggested some minor improvements to diff3. We’ve improved upon those suggestions to propose an even better format.

JSON is now a widely used format for data both in web applications and more generally. However, systems and APIs that exchange JSON haven’t been able to take advantage of tracking tools. Can this be helped by processing JSON as XML?

Learn how DeltaXML is helping documentation specialists in the pharmaceutical, medical and healthcare industries to transform the efficiency and accuracy of content change and merge.

A new approach to representing change in CALS tables

Our new CALS tables algorithm means complex change isn’t complicated to understand.