Skip to main content
Skip table of contents

Samples and Guides

Expanding on the high-level User Guide, the following samples and guides consider common use-cases and other features available with XML Compare and its included filters. 

Samples provide documentation, code, data files and ant scripts that can be run with an evaluation or the full product. The document, available on this website, describes the concepts behind each sample. The resources associated with each sample can be downloaded from Bitbucket.  Bitbucket is a system for hosting repositories, owned by Atlassian. It allows DeltaXML to provide the latest version of our samples, making them available for download.  See below for the links to Bitbucket.

The samples are designed for use with very limited data and may not run efficiently or effectively with larger data files.

Guides are stand-alone documents available on this website.

Comparisons in XML Compare are typically performed using either the Pipelined Comparator or the Document Comparator. Both of these comparators can be configured and customized with additional filters through their respective APIs. Alternatively, the Pipelined Comparator can be customized via an XML file, referred to as a 'DXP', while the Document Comparator can be customized via a 'DCP' XML file.

Many of the samples here demonstrate how the same feature can be implemented using either the Pipelined or Document Comparator; other samples are dedicated to showing the use of just one of the comparator types. In some cases, the alternative comparator may have no equivalent feature. The Document Comparator, for example, has a built-in feature for 'formatting elements', it is therefore just this comparator that is used in the 'Formatting Element Changes' sample. Please see the Choosing the Comparator section of the User guide for further details.

Sample files are published on Bitbucket. Look for the Downloads option in the sample that you are interested in.

There is an explanation of the table headings in the Samples Key section below. 

XML Documents

  • Samples:

Title/Description

DC

PC

DXP

DCP

Word by Word Text Comparison How to perform a detailed comparison on textual changes using filters included with XML Compare.

Character by Character Comparison How character by character comparison can be performed.

Formatting Element Changes

Why inline formatting elements need special processing in order to minimise the impact that changing them has on the result file.

Preserving Doctype Information

How to include doctype information in the result file that is determined by the input file doctype rather than hard-coded into the pipeline.

Preserving Processing Instructions and Comments

How to convert processing instructions and comments into XML markup (and back again) so that they are not removed by XML Compare.

Preserving Entity References

How to retain entity references in the comparison output.

Image and Binary Comparison

How referenced images and other binary resources can be compared.

XML Data

Title/Description

DC

PC

DXP

DCP

Comparing Orderless Elements How and why to instruct XML Compare to treat XML data as an orderless set of elements.

Detecting and Handling Moves

An example pipeline showing how to post-process a delta file to detect and mark data that has been moved.

Numeric Tolerances

An example pipeline showing how to post-process a delta file to allow for tolerances when comparing numerical data.

XML Documents & XML Data

Title/Description

DC

PC

DXP

DCP

Ignoring Changes

An example pipeline showing how to post-process a delta result to "ignore" certain changes.

Creating a Merged Document

 An example pipeline showing how to merge two documents

Using Keys with Ordered Data to Improve Matching

When and how to add DeltaXML 'keys' to your input data in order to have more control over the matching process

Using XInclude with XML Compare

An example pipeline that instructs the XML parser to process XInclude statements before passing the input data to XML Compare.

DXP/DCP Filter Pipelines

Title/Description

DC

PC

DXP

DCP

Specifying a pipeline using DXP or Java

How to set up a PipelinedComparator. Also how DXP pipelines relate to our APIs using either Java or C# code.

Folding DiffReport with DCP

A demonstration of the capabilities of the folding DiffReport output format.

Format Specific Information

Integrating XML Compare

The following discuss using the Java APIs and are generally independent of any filters used in the processing pipelines.

Title/Description

DC

PC

DXP

DCP

Using a Catalog Resolver

A code sample to show how to instruct XML Compare to make use of catalog files.

Using W3C DOM Documents

A simple code sample showing how to use in memory DOM structures as inputs/outputs.

Using XOM

A simple code sample showing how to use in memory XOM structures as inputs/outputs.

DiffReport Sample Servlet

An example servlet showing how XML Compare could be used and deployed in a servlet engine or Java EE application server. Also serves as a multithreaded test case.

Using Deltas for XML Versioning (diff and patch)

A simple code sample showing how to use a mixture of comparison and recombination demonstrating how XML Compare can be used manage XML versioning.

Samples Key

DC = sample includes Document Comparator usage via API

PC = sample includes Pipelined Comparator usage via API

DXP = sample includes Pipelined Comparator usage via DXP file

DCP = sample includes Document Comparator usage via DCP file

Other Files

Guides

Samples

The following documents point to directories that contain source code for you to use or adapt as necessary.

DXP

       Pointers to sample DXP pipeline configuration files, corresponding to the pipelines included in the XML Compare GUI and command-line processor by default. Also a DTD for ensuring DXP validity.

DCP

       Pointers to sample DCP pipeline configuration files, corresponding to the pipelines included in the XML Compare GUI and command-line processor by default. Also annotated XML Schemas (for XML Schema v1.0 and 1.1) to assist with editing and ensure validity.

XSL Filters

       Various XSL filters are included for use in your pipelines, or used in other code samples.

JavaScript errors detected

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

If this problem persists, please contact our support.