By Business Need
Version Control & Collaboration
Data Consistency & Management
AI & Automation
By Industry
Aviation
Manufacturing
Legal
By Markup & Data Format
XML
JSON
HTML
Core Technology
DeltaCompare
DeltaMerge
DeltaCheck
Patents
Integration & Automation
Customisable Pipelines
Flexible APIs

Typically, the DeltaXignia Core product is used to compare XML content, but have you ever considered using the Core product to compare non-XML documents? In this blog post, I experiment with using Core to compare (non-XML) XQuery code.
The objective here is to use a DXP Pipeline Configuration file to define a pipeline for the Core comparator. Two simple XSLT filters are to be used, one for input, the other for output. The input filter converts XQuery to XML with one element for each token, it exploits an imported tokenizer function for XQuery – from the open source XMLSpectrum project (for which I’m currently the sole contributor).
A high-level view of the XQuery pipeline I developed is shown below:
A view of the configured pipeline
For this experiment I’m using the Java version of Core and invoking the comparison from an Ant build file. Within this, the run target invokes the DeltaXignia command.jar with 5 command-line arguments:
compare The Core method to invokexquery The id attribute of the Pipeline Configuration fileinput-file1.xml Input XML file 1 – holds the URI of the 1st XQuery file to compareinput-file2.xml Input XML file 2 – holds the URI of the 2nd XQuery file to compareresult.html The destination file