Table of Contents
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.
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.
Each invocation of the DeltaXML command-line has a subcommand name, followed by options and arguments.
The subcommands are:
Provides version information and an informative message about available options.
Provides a description of the configuration passed as an argument, including available parameters
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.
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
Takes a single configuration id argument. For a list of available configuration ids, run
java -jar command.jar status
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
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
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>.
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
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.