Testing using Sample Command Line Driver
The provided sample command-line driver can be used to experiment using REST from the command-line.
The command-line driver was written as proof of concept to demonstrate use of the REST API, and is not intended as a primary way of interacting with it.
Source code for the command-line driver is available as an IntelliJ/Maven project in a Bitbucket repo - XML Compare REST Java Client. Please customize as needed. This client doesn't use 'model' POJOs corresponding to requests and responses in the API. Instead it processes responses as Strings and use XPath to process results.
Functionality of the REST command-line driver is similar to the Java API-based command-line driver.
For example:
$ java -jar deltaxml-rest-client-13.0.0.jar describe diffreport
DeltaXML XML Compare REST Beta driver. (C) 2022 DeltaXML Ltd. All rights reserved.
Pipeline ID: diffreport
Short Description:
[DXP] XML Compare, output HTML folding report
Full Description:
[Uses PipelinedComparatorS9] This configuration is used to produce a HTML folding differences report to be viewed in a browser.
Pipeline Parameters:
Name | Type | Default Value | Description
--------------------------------+-----------+----------------------+---------------------------------------------------
Preserve Whitespace | boolean | false | whether to normalise whitespace before comparison
Word By Word | boolean | false | whether to compare PCDATA in a more detailed way
Enhanced Match 1 | boolean | true | whether to use the 4.x enhanced matcher that is tailored to comparing documents
add-all-namespace-declarations | boolean | false | If true, all namespaces in rendering are declared in-situ - otherwise, only root element namespaces are declared
minimize-unchanged-display | boolean | false | Collapse and do not embed unchanged subtrees in result - helps minimize file size
no-fold-size | string | 50 | Childless nodes of character-length less than this are shown in full - and are not foldable
important-attribute-list | string | id,name,property,key | Comma-separated list of attributes that are important for element alignment purposes
--------------------------------+-----------+----------------------+---------------------------------------------------
$
$
$ java -jar deltaxml-rest-client-13.0.0.jar compare diffreport \
samples/WordByWord/build.xml samples/XInclude/build.xml bdiff.html
DeltaXML XML Compare REST Beta Driver. (C) 2022 DeltaXML Ltd. All rights reserved.
Progress: QUEUED STARTED INPUTS_LOADING_A INPUTS_LOADING_B INPUT_FILTERS COMPARISON_RUNNING OUTPUT_FILTERS SAVING FINISHED
Result written to bdiff.html
$ open bdiff.html
The client defaults to http://localhost:8080
but this can be changed by using the host
property.
For example, if the REST service is running on port 1234 instead of 8080:
java -jar -Dhost=http://localhost:1234 deltaxml-rest-client-13.0.0.jar
In these samples, references to the deltaxml-rest-client-13.0.0.jar should be modified to match the major.minor.patch version of XML Compare you are using.
Also, if using a Windows terminal, the '\' line-continuation character should be replaced with '^' character.