Skip to main content
Skip table of contents

Specifying Merge Versions

XML / JSON Requests

Concurrent

Concurrent Merge takes three or more versions, with one version treated as the "ancestor" or original to each of the other versions that are compared.

Each version needs a name, and an input. See I/O types for more information.

As such, you can specify three or more versions, and the first in the set of versions will be treated as the ancestor. For example:

XML

Request
XML
<Concurrent>
  <Versions>
    <Version type="file" name="anna">
      <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-anna.html</Path>
    </Version>
    <Version type="file" name="ben">
      <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-ben.html</Path>
    </Version>
    <Version type="file" name="chris">
      <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-chris.html</Path>
    </Version>
  </Versions>
  <Configuration>
    <Indent>false</Indent>
    <RuleConfiguration>
      <DisplaySimpleAdds>false</DisplaySimpleAdds>
      <DisplaySimpleDeletes>false</DisplaySimpleDeletes>
      <DisplaySimpleModify>false</DisplaySimpleModify>
      <DisplayChangesTo>//*</DisplayChangesTo>
      <VersionPriorityList>
        <VersionPriority>chris</VersionPriority>
        <VersionPriority>ben</VersionPriority>
        <VersionPriority>anna</VersionPriority>
      </VersionPriorityList>
      <DisplayChangesInvolving>
        <VersionIdentifier>chris</VersionIdentifier>
        <VersionIdentifier>ben</VersionIdentifier>
      </DisplayChangesInvolving>
    </RuleConfiguration>
  </Configuration>
  <ResultType>DELTAV2</ResultType>
</Concurrent>

JSON

Request
JS
{
  "Versions": [
    {
      "type": "file",
      "name": "anna",
      "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-anna.html"
    },
    {
      "type": "file",
      "name": "ben",
      "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-ben.html"
    },
    {
      "type": "file",
      "name": "chris",
      "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-chris.html"
    }
  ],
  "Configuration": {
    "Indent": false,
    "RuleConfiguration": {
      "DisplaySimpleAdds": false,
      "DisplaySimpleDeletes": false,
      "DisplaySimpleModify": false,
      "DisplayChangesInvolving": [
        "chris",
        "ben"
      ],
      "DisplayChangesTo": "//*",
      "VersionPriorityList": [
        "chris",
        "ben",
        "anna"
      ]
    }
  },
  "ResultType": "DELTAV2"
}

Sequential

Like Concurrent Merge, Sequential Merge takes three or more versions. These are then merged sequentially - in the order you specified, which needs to be the same as the order they were edited. Specifying versions in Sequential is the same as Concurrent:

XML

Request Excerpt
XML
<Sequential>
  <Versions>
    <Version type="file" name="anna">
      <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-anna.html</Path>
    </Version>
    <Version type="file" name="ben">
      <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-ben.html</Path>
    </Version>
    <Version type="file" name="chris">
      <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-chris.html</Path>
    </Version>
  </Versions>
  ....
</Sequential>

JSON

Request Excerpt
JS
{
  "Versions": [
    {
      "type": "file",
      "name": "anna",
      "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-anna.html"
    },
    {
      "type": "file",
      "name": "ben",
      "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-ben.html"
    },
    {
      "type": "file",
      "name": "chris",
      "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-chris.html"
    },
    {
      "type": "file",
      "name": "david",
      "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-david.html"
    }
  ],
  ....
}

Three Way Merge

As the name suggests, there are only three versions in a Three Way Merge. We have simplified how to specify versions in Three Way Merge by explicitly naming the versions:

XML

Request Excerpt
XML
<ThreeWayMerge>
  <Ancestor type="file" name="anna">
    <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-anna.html</Path>
  </Ancestor>
  <VersionOne type="file" name="ben">
    <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-ben.html</Path>
  </VersionOne>
  <VersionTwo type="file" name="chris">
    <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-chris.html</Path>
  </VersionTwo>
  ....
</ThreeWayMerge>

JSON

Request Excerpt
JS
{
  "Ancestor": {
    "type": "file",
    "name": "anna",
    "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-anna.html"
  },
  "VersionOne": {
    "type": "file",
    "name": "ben",
    "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-ben.html"
  },
  "VersionTwo": {
    "type": "file",
    "name": "chris",
    "Path": "/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits-chris.html"
  },
  ....
}

multipart/form-data Requests

Concurrent and Sequential

When using Concurrent or Sequential Merge, the part name is used as the version identifier in the merge - i.e. enter any valid name NMTOKEN isn't a parameter otherwise used by XML Merge REST e.g. Async.

There is an additional parameter, VersionOrder, used with multipart/form-data to clarify the order of the versions - a comma separated list of the version names.

In Concurrent Merge the first item in this list will be assumed to be the ancestor.

CODE
.....
Content-Disposition: form-data; name="base"
http://www.example.com/file1.xml
--boundary
Content-Disposition: form-data; name="anna"
http://www.example.com/file2.xml
--boundary
Content-Disposition: form-data; name="ben"
http://www.example.com/file3.xml
--boundary
Content-Disposition: form-data; name="VersionOrder"
base,anna,ben
--boundary
.....

Three Way Merge

This is similar to an XML or JSON request - there are predefined part names for Ancestor, VersionOne, and VersionTwo. There are additional optional parameters corresponding to each input's version identifier e.g. AncestorName.

If names aren't specified then the values "ancestor", "version-one" and "version-two" will be used.

CODE
.....
Content-Disposition: form-data; name="Ancestor"
http://www.example.com/file1.xml
--boundary
Content-Disposition: form-data; name="AncestorName"
base
--boundary
Content-Disposition: form-data; name="VersionOne"
http://www.example.com/file2.xml
--boundary
Content-Disposition: form-data; name="VersionOneName"
anna
--boundary
Content-Disposition: form-data; name="VersionTwo"
http://www.example.com/file3.xml
--boundary
Content-Disposition: form-data; name="VersionTwoName"
ben
--boundary
.....
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.