Delta Output Merge Format
The Delta Output Merge format is the native output format of Merge. It extends the standard two-document DeltaV2 comparison format to support N-way merges with multiple named version identifiers.
Features of the DeltaV2 Merge Output
-
Contains all of the data from all of the input files; any of the input files can be extracted without loss.
-
Structure follows that of the input files (e.g. the root element will be the same).
-
Describes all of the changes to elements, text and attributes using an expanded DeltaV2 format that supports n-way merge.
-
DeltaV2 version identifiers are specified through the API prior to processing and appear in the output.
-
Format is versatile and optimised for further processing to resolve differences.
DeltaV2 Attributes
The deltaxml:deltav2 attributes in the delta output contain a sequence of one or more 'version identifiers' joined by the '=' character or '!=' character-pair.
The DeltaV2 attributes conform to the following rules:
-
Where document versions have the same content at the level of the attribute they are referred to as being within an equality group and the version identifiers are joined using the
=character within this group. -
Document versions with different content are separated by the
!=character-pair. -
Within equality groups and between equality groups (i.e. groups of versions separated with
!=) the versions are ordered according to an ordering sequence specified in the deltaxml:version-order element defined on the document root element. The version-order attribute contains a comma separated list of version identifiers.
A sample DeltaV2 attribute value from Merge:
ancestor=anna!=ben=chris!=david
Version Identifiers
Version identifiers are user-specified labels assigned to the common ancestor and each revision document. An identifier must be supplied each time a new document is added and each new identifier must have a unique value.
Choosing Values for Version Identifiers
Version identifiers may be user-specified or machine generated (provided they meet the constraints outlined below). For example, the revision numbers or hash values used in a version control system could be used.
Constraints on Version Identifiers
Version identifiers should conform to the NMTOKEN production rule defined in the XML Specification. The same production rules are used in both the XML 1.0 and XML 1.1 specifications. This production rule allows many unicode characters, but prohibits the use of the ! (hex value 0x21) and = characters (hex value 0x3b) which are used as the version separators as discussed above and also space characters.
Other Functionality in the Merge Variant
-
Supports n-way merge.
-
DeltaV2 version identifiers specified using the API appear in the result DeltaV2 attributes instead of the single characters in Compare and Sync.
-
The version-order attribute is used to provide a persistent record of the order in which documents were added to the merger object.
-
Additional attributes, showing the results of a merge analysis, may also be present in the result.
Content Groups
The content group deltaxml:contentGroup is used to describe changes involving entity references, processing instructions and comments. This element is modelled on the deltaxml:textGroup element, but relaxes the restriction that the child elements (in this case deltaxml:content being equivalent to deltaxml:text) must only contain text nodes.
The contentGroup provides alternative content that appears in similar positions in each of the files. The deltaxml:content child elements provide the alternative content and their DeltaV2 attributes indicate which of the input files contained that content.
The following example indicates how a contentGroup is used to show that different entity references are used in corresponding locations in the merge inputs.
<p deltaxml:deltav2="ancestor=edit1!=edit2">Example of entity preservation
<deltaxml:contentGroup deltaxml:deltav2="ancestor=edit1!=edit2">
<deltaxml:content deltaxml:deltav2="ancestor=edit1">&t1;</deltaxml:content>
<deltaxml:content deltaxml:deltav2="edit2">&t2;</deltaxml:content>
</deltaxml:contentGroup></p>
Differences from the shared format
-
DeltaV2 member values: user-selected version identifier strings used instead of auto-generated single characters.
-
Number of members: There may be more than three members in a DeltaV2 attribute to support n-way merge.
-
The required top-level attribute
deltaxml:content-typewill have different values in XML Merge results. The valuessimplified-merge-concurrentandsimplified-merge-sequentialrepresent concurrent and sequential editing respectively.