3. XPT command-line options

The following command-line options are recognised by xpt:

xpt [-h] [-k] [-c cmd] [-F] [-i infile] [-I dir] [-n] [-o outfile] [-s cmd] [-t stylesheet] [-T pi-name] [-f all-func] [-P init-cmd] [-D name=[=[value]]] [-x] [-v] [-V]

-c cmd

enter command mode. Currently the following values are allowed:

ppi

process processing-instructions. this is the default value.

version

show version information. same as the -V.

-D name[=value]

define variable name optionally with value value.

-f all-func

register a single function for all selected XML elements. Usually needs -P option to get function installed.

-F

use fancy XML output format for better readability.

-h

show some help.

-i infile

read XML from infile. If not specified, standard input is assumed. If infile is explicitly specified as - (dash), the standard input is read.

-I dir

append dir to list search directories of xpt and embedded Python engine.

-k

keep temporary files

-n

do not execute external commands

-o outfile

send output to output.

[Note]Note

needs extra explanation out how the output is created. read the code.

-P init-cmd

issue init-cmd command before transforming selected elements. Most often a module is loaded using this option. This option may be used more than once.

-s cmd

use XPath cmd in while creating output.

-t stylesheet

use XSLT stylesheet in output generation

-T pi-name

change name of processing-instruction target to pi-name. Default is xpt.

-x

Show debug output. This option may be used more than once to increase the verbosity.

-v

Be verbose.

-V

Show version information.