2.3. Using xxetool to compare documents

Usage:

xxetool [Advanced Option]* compare [Other Option]* Options
    -on [file_or_URL]+ |
    -off [file_or_URL]+ |
    -revon [file_or_URL]+ |
    -revoff [file_or_URL]+ |
    -addrev out_file file_or_URL [file_or_URL]+ |
    -cmp|-diff file_or_URL1 file_or_URL2

Options:

-on [file_or_URL]+

Enable the comparison of revisions in all specified documents. This implies adding <?xxe-sn> processing-instructions to all elements and then saving the modified document to disk.

No effect if comparison of revisions is already enabled in a document.

file_or_URL may specify a local directory, in which case this directory is recursively traversed.

-off [file_or_URL]+

Do not keep any information about revisions in all specified documents. This implies removing all <?xxe-sn> processing-instructions and possibly also the <?xxe-revisions> processing-instruction from the document and then saving the modified document to disk.

No effect if a document already does not contain any information about revisions.

file_or_URL may specify a local directory, in which case this directory is recursively traversed.

Note that option -off implies option -revoff; no need to specify both.

-revon [file_or_URL]+

Start storing revisions in all specified XML documents. This implies adding <?xxe-sn> processing-instructions to all elements, adding a single <?xxe-revisions> processing-instruction at the end of a document and then saving the modified document to disk.

No effect if a document already stores the revision history.

file_or_URL may specify a local directory, in which case this directory is recursively traversed.

Note that option -revon implies option -on; no need to specify both.

-revoff [file_or_URL]+

Stop storing revisions in all specified XML documents. This implies removing the <?xxe-revisions> processing-instruction found at the end of the document and then saving the modified document to disk.

No effect if a document already does not store the revision history.

file_or_URL may specify a local directory, in which case this directory is recursively traversed.

-addrev out_file file_or_URL [file_or_URL]+

All specified file_or_URL files being revisions of the same document, store in out_file all these revisions. Specified file_or_URL files are automatically sorted by their date. File out_file is basically a copy of the most recent revision.

-cmp file_or_URL1 file_or_URL2

Compare specified documents. If these documents differ, print the changes on the console.

The documents being compared must be two revisions of the same initial document in which the comparison of revisions has been enabled.

The arguments may specify two local directories, in which case these directories are recursively traversed in parallel.

-diff file_or_URL1 file_or_URL2

Same as -cmp except that changes are not detailed. If one or more documents differ, xxetool simply exits with a non-zero exit code.

Other options:

-v|-vv|-vvv

Turn verbosity on. The more Vs, the more verbose.

Advanced options:

-auth credentials

This option can be used to specify authentication credentials for a given server. This allows to connect to the specified server without interactively asking the user to enter a username and a password.

String credentials consists in 6 fields: host, port, prompt, scheme, username, password, in that order, separated by a newline character ('\n'). Fields host, port, prompt, scheme can be left empty, which means: match any. The UTF-8 bytes of the string are then encoded in base-64.

Command-line utility XXE_install_dir/bin/authvalue allows to generate such encoded string. Example: encode string "\n\nDocument Store\n\nvictoria\nsecret":

/opt/xxe/bin$ authvalue victoria secret - "Document Store"
CgpEb2N1bWVudCBTdG9yZQoKanZpY3RvcmlhCnNlY3JldA==

/opt/xxe/bin$ xxetool convert -auth CgpEb2N1bWVudCBTdG9yZQoKanZpY3RvcmlhCnNlY3JldA== \
docb.toHTML http://www.acme.com/docstore/push_up.xml -u docs/

Command-line utility authvalue is auto-documented. Type authvalue, then press Enter to display a short documentation explaining how to use this utility.

-putpref key value

Adds or replace preference specified by key/value to the set of the user's preferences.

Note that the -putpref, -putprefs, -delprefs options change the user's preferences only during this invocation of xxetool. xxetool reads, but never writes the contents of file XXE_user_preferences_dir/preferences.properties.

-putprefs property_file_or_URL

Similar to -putpref except that several key/value pairs may be read from specified property file.

-delpref key

Removes preference specified by key from the set of the user's preferences.