Command-Line Tool ReadMe


Table of Contents

1. Introduction
2. General Usage
3. Supported commands
4. Command Arguments
5. Resolvers
6. Extensibility
7. Support

1. Introduction

Although DeltaXML software provides an API which can be embedded in applications or server processes for internal or OEM applications, some evaluators may wish to experiment with a simple command line process.

The file command.jar included in this distribution allows the core DeltaXML differencing and recombination engines engine to be invoked, together with a range of input and output filters on the command line.

2. General Usage

The command.jar file is packaged as an 'executable jar' for invocation in a shell environment (a 'DOS box' or 'command.com' on windows or a terminal window with shell interpreter on Unix/MacOSX/Linux/...).

The general form of invoking involves specifying the command.jar file with -jar as an argument to the java command.

For example:

    java -jar command.jar subcommand ...
    java -jar ../command.jar subcommand ...
    java -jar /usr/local/DeltaXMLCore-5_0/command.jar subcommand ....
    java -jar C:\DeltaXMLCore-5_0\command.jar subcommand ....
    

It should be noted that the command.jar file should always be in the same location as deltaxml.jar; we do not recommend moving or copying these jar files once installed. You should use a relative or absolute file path to their install locations as in the above examples.

3. Supported commands

Each invocation of the DeltaXML command-line has a subcommand name, followed by options and arguments.

The subcommands are:

status

Provides version information and an informative message about available options.

describe

Provides a description of the configuration passed as an argument, including available parameters

compare

Used to perform a comparison of two input files to produce an output file. Arguments includes a configuration id, three file arguments and optional configuration parameter arguments.

recombine-forward and recombine-reverse

These commands can be used in conjunction with 'compare delta' to do 'round-trip' processing, ie one of the original input files can be generated from the delta file and the other input file.

Note: to allow recombination, the delta file produced must be a 'raw' delta file. This means that when using 'compare delta' as a command, you must also specify the pipeline parameters:

"Full Context=false"

,

"Word By Word=false"

and

Indent=no

Thus the whole command would read

java -jar command.jar compare delta input1.xml input2.xml result.xml "Full Context=false" "Word By Word=false" Indent=no

4. Command Arguments

describe

Takes a single configuration id argument. For a list of available configuration ids, run

java -jar command.jar status

compare

Takes a configuration id and 3 file arguments. Optional parameter overrides can also be included. Examples:

    java -jar command.jar compare delta doc1.xml doc2.xml delta-1-2.xml
    java -jar command.jar compare diffreport doc1.xml doc2.xml report.html "Word By Word=true"
            

Parameter overrides are always of the form param=value, with surrounding quotes if spaces are present. For a list of available parameters, use

java -jar command.jar describe configuration-id

recombine-forward and recombine-reverse

The recombine commands take 3 arguments, the first argument is one of the original input files, the second is a delta file, and the third is the regenerated version of the other input file, for example:

    java -jar command.jar compare delta doc1.xml doc2.xml delta-1-2.xml "Full Context=false" Indent=no
    java -jar command.jar recombine-forward doc1.xml delta-1-2.xml regen-2.xml
    java -jar command.jar recombine-reverse doc2.xml delta-1-2.xml regen-1.xml
            

5. Resolvers

As of version 1.3 of the command line comparator it is possible to set a URIResolver and/or EntityResolver to be used during comparison. This is achieved using system properties passed to the java command as follows:

      java -jar command.jar -Dcom.deltaxml.cmdline.URIResolver=com.mine.MyURIResolver 
                            -Dcom.deltaxml.cmdline.entityResolver=com.mine.MyEntityResolver ...
    

The value of the com.deltaxml.cmdline.URIResolver property should be the class name of a class which implements the javax.xml.transform.URIResolver interface. Similarly the com.deltaxml.cmdline.entityResolver property should describe an implementation of the org.xml.sax.EntityResolver interface. Any such implementations should also be present on the runtime classpath.

The entityResolver is used when parsing the input files and could be used to locate/redirect XML external entities including the external DTD subset (or doctype referenced by the systemId) and notations. The URI resolver is used during filter processing and may be relevant when locating files referenced through document(), <xsl:import> or <xsl:include>.

6. Extensibility

It is possible to change the functionality of the command line tool by including customised configuration files in specific directories. The configuration files should be DXP files (see Guide to DeltaXML Pipeline Configuration for more information on DXP) and should be placed in one of the following directories:

  • command.jar installation directory

  • current working directory i.e. the directory where the command is being invoked

  • user home directory

Any DXP files found in these directories will be available for use as a command line tool configuration. To see which configurations are currently available, use

java -jar command.jar status

7. Support

Please make use of our Support Forums and Technical Documentation if you need help using the command-line tool or any other part of DeltaXML Core.