XML Diff

Usage

The XML Diff utility determines the differences between XML documents, XML elements or variables that include XML documents.

The XML Diff utility is often used for determining the differences between an older and a newer version of an XML document and for detecting the changes that have been made in the meantime.

Finding out the differences of XML documents requires a lot of processing power. Therefore, Virtimo AG recommends using a high-performance CPU with high clock frequency and several cores.

Prerequisites

An XML structure as input message is expected.

XML Diff Output Message

The differences are displayed in an XML output message below the insert, update, or delete elements.

They refer to the corresponding text nodes of elements and attributes. The number of differences can be retrieved from the count attribute below the XmlDifferences element, e.g.:

<?xml version="1.0" encoding="UTF-8"?>
<XmlDifferences count="3">
  <Difference>
    <Type>delete</Type>
    <Path>
      /ns1:Root/Document/Position[3]/Price
    </Path>
    <nodeType>Element</nodeType>
    <nodeName>Price</nodeName>
    <oldValue>12.36</oldValue>
  </Difference>
  <Difference>
    <Type>update</Type>
    <Path>
      /ns1:Root/Document/Position[3]/Article
    </Path>
    <nodeType>Element</nodeType>
    <nodeName>Article</nodeName>
    <oldValue>table</oldValue>
    <newValue>chair</newValue>
  </Difference>
  <Difference>
    <Type>insert</Type>
    <Path>/ns1:Root/@orderID</Path>
    <nodeType>Attribute</nodeType>
    <nodeName>orderID</nodeName>
    <newValue>0815</newValue>
  </Difference>
</XmlDifferences>

XML Diff Module Properties Dialog

In this dialog, you define which XML structures (XML documents, XML elements, or XML variables) are to be compared.

Base document

Select one of these options:

  • D: Indicates an element in an XML document. Click the icon to open the XPath assistant.

  • V: Indicates a variable of the `xs:anyElement `type, which includes an XML document. Enter the name of the variable or select it from the drop-down list.

  • S: For importing a static XML document into the module.

File:

  • module guide 1282 2 Click this icon to select an XML document that serves as the basis for comparison.

  • module guide 1282 3 Click this icon to open a watch point file (*.wpf file).

  • module guide 1282 4 Click this icon to open a file from the INUBIT Repository.

  • module guide 1282 5 Click this icon to insert the XML structure from the clipboard.

  • module guide 1282 6 Click this icon to edit the indicated XML document.

Comparative document

The comparative document contains the same options as the base document.

Activate the Highlight Differences checkbox to highlight the difference when opening the tree structure in the watch point file.

The result of the XML Diff utility may be different from previous INUBIT versions due to implementation changes. Existing workflows need to be adjusted.