Skip to main content
Skip table of contents

Requests

A merge operation is performed by invoking an HTTP POST method with inputs and parameters for a specified merge type. The HTTP POST requests can be made in three different ways:

  • A multipart/form-data request (this is required if you need to upload files from the client)

  • A single XML request

  • A single JSON request

There are two types of connection that can be made using the POST request, a Synchronous connection, or an Asynchronous connection.

Synchronous

Here is a simple synchronous example using Concurrent Merge. In this example there are three versions specified. The versions will be added to the merger in the order specified. There are also various parameters set.  These include settings for indentation and result type.  See the page Specifying Parameters for details of the parameters.

multipart/form-data Requests

Examples of multipart/form-data requests are available on the Postman documentation. The following links provide examples of multipart/form-data requests for each merge type

XML Request Example

Request
XML
<ConcurrentMerge>
  <Versions>
    <Version type="file" name="anna">
      <Path>/usr/local/deltaxml/DeltaXML-Merge-6_0_1_j/samples/html-data/four-edits.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>true</Indent>
  </Configuration>
  <ResultType>RULE_PROCESSED_DELTAV2</ResultType>
</ConcurrentMerge>

JSON Request Example

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": true
  },
  "ResultType": "RULE_PROCESSED_DELTAV2"
}

XML Result

Response Excerpt
XML
<html xmlns:deltaxml="http://www.deltaxml.com/ns/well-formed-delta-v1" deltaxml:version-order="anna, ben, chris" deltaxml:content-type="merge-sequential" deltaxml:version="2.0" deltaxml:deltaV2="anna!=ben!=chris">
   <head deltaxml:deltaV2="anna!=ben!=chris">
      <title deltaxml:deltaV2="anna!=ben!=chris">
         <deltaxml:textGroup deltaxml:deltaV2="ben">
            <deltaxml:text deltaxml:deltaV2="ben">An </deltaxml:text>
         </deltaxml:textGroup>Example for DeltaXML Merge
      </title>
   </head>
   <body deltaxml:deltaV2="anna!=ben!=chris">
    ....
   </body>
</html>
JavaScript errors detected

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

If this problem persists, please contact our support.