XML Compare is a powerful tool for comparing and managing changes between XML files. One of its key features is the ability to define custom comparison pipelines, allowing users to tailor the comparison process to their specific needs.
Customising Comparison Pipelines
With XML Compare, you can define comparison pipelines using either the PipelinedComparatorS9 or the DocumentComparator class.
- Pipelined Comparator: This class provides a highly flexible form of comparison, ideal for scenarios where the input XML is not always document-based or where you require low-level control of the processing pipeline. You can add input and output filters to the processing pipeline at any point, giving you fine-grained control over the comparison process.
- Document Comparator: Unlike the Pipelined Comparator, the Document Comparator has a pipeline specially optimised for document comparison. This pipeline is modified by adding filters at certain named ‘extension points’.
![](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20813%20306'%3E%3C/svg%3E)
Defining Pipelines
You can define comparison pipelines using Java code or an XML pipeline descriptor file format called DXP.
- Using Java: You can define pipelines using Java code, adding filter steps or chains directly to the comparator classes.
- Using DXP: DXP is an XML-based format for defining comparison pipelines. It allows you to specify input and output filters, comparator features and properties, and much more in a structured XML format.
Pipeline Diagnostics
XML Compare also offers a debug mode for diagnosing issues in your comparison pipelines. In this mode, the inputs and outputs of each filter are output to separate files, making it easier to identify and resolve any issues.
Configuration
XML Compare offers a range of configuration options to fine-tune the comparison process. These options include settings for diagnostics, output format, parser features, and more. To see these configuration options in action, watch the product demo below, which showcases two popular configuration features: word-by-word text comparison and comparing orderless elements.