Chapter 2. Configuration

XML Calabash reads configuration information from several sources. The default configuration, built into the application, is augmented by user-specified configuration files, system properties, and command line options, generally in that order.

This chapter summarizes the configuration options, irrespective of how they're set.

1. Saxon processor

There are three classes of Saxon processor: “home edition”, “professional edition”, and “enterprise edition”. There are four ways to select the edition you wish to use:

Command line (long): --saxon-processor=edition
Command line (short): -Pedition
Java system property: com.xmlcalabash.saxon-processor=edition
XML configuration: <cc:saxon-processor>edition</cc:saxon-processor>

Where edition is one of “he”, “pe”, or “ee”. The actual edition that you get will depend on where the Saxon jar files appear on your classpath. XML Calabash will proceed even if it cannot obtain the requested edition, but dynamic errors will occur if you attempt to use features not available in the edition actually used.

Schema aware processing requires “enterprise edition”; if you request schema aware processing, the processor option is treated as if you'd requested “ee” irrespective of what you actually specified.

2. Saxon configuration

The Saxon “professional edition” and “enterprise edition” processors can load an external configuration file to control various aspects of the Saxon processor. There are three ways to specify the location of this file:

Command line (long): --saxon-configuration=filename
Java system property: com.xmlcalabash.saxon-configuration=filename
XML configuration: <cc:saxon-configuration>filename</cc:saxon-configuration>

The settings in this file take precedence over other, related settings available in Calabash (for example, schema awareness or processor type). This option will cause XML Calabash to throw an error if you are using “home edition”.

3. Schema aware processing

There are four ways to enable schema aware processing:

Command line (long): --schema-aware[=boolean]
Command line (short): -a
Java system property: com.xmlcalabash.schema-aware=boolean
XML configuration: <cc:schema-aware>boolean</cc:schema-aware>

Schema aware processing requires Saxon EE. If schema aware processing is enabled, then PSVIs are passed between steps.

4. Debug

There are four ways to enable debugging:

Command line (long): --debug[=boolean]
Command line (short): -D
Java system property: com.xmlcalabash.debug=boolean
XML configuration: <cc:debug>boolean</cc:debug>

If debugging is enabled, errors will produce Java stack traces.

5. Safe mode

There are three ways to enable safe mode:

Command line (long): --safe-mode[=boolean]
Command line (short): -S
XML configuration: <cc:safe-mode>boolean</cc:safe-mode>

If safe-mode is enabled, only XProc standard steps can be instantiated and any attempt to access the local filesystem will result in a dynamic error.

6. Alternate configuration file

An alternate configuration file can be loaded from the command line:

Command line (long): --config configuri
Command line (short): -c configuri

T.B.D.

7. Logging style

There are two ways to specify the logging style:

Command line (long): --log-style=style
Command line (short): -Gstyle

The default logging style for p:log output is “wrapped”. You can specify alternate styles of “plain”, “directory”, or “off” to suppress all p:log output. The value “off” disables all logging, even if individual p:log elements specify an alternate style with cx:logstyle.

8. Entity resolver

There are four ways to specify the entity resolver:

Command line (long): --entity-resolver=classname
Command line (short): -Eclassname
Java system property: com.xmlcalabash.entity-resolver=classname
XML configuration: <cc:entity-resolver>classname</cc:entity-resolver>

The class specified will be instantiated and used as the entity resolver for all XML documents accessed.

9. URI resolver

There are four ways to specify the URI resolver:

Command line (long): --uri-resolver=classname
Command line (short): -Uclassname
Java system property: com.xmlcalabash.uri-resolver=classname
XML configuration: <cc:uri-resolver>classname</cc:uri-resolver>

The class specified will be instantiated and used as the URI resolver for all URIs accessed.

10. Extension

There are four ways to specify extensions:

Command line (long): --extension=extname
Command line (short): -Xextname
Java system properties: com.xmlcalabash.general-values=boolean
com.xmlcalabash.xpointer-on-text=boolean
com.xmlcalabash.transparent-json=boolean
XML configuration: <cc:extension name="extname" value="boolean"/>

Valid extension names are “general-values”, “xpointer-on-text”, and “transparent-json”.

11. Binding

There are two ways to specify a namespace binding in the configuration:

Command line (long): --binding prefix=uri
Command line (short): -bprefix=uri

These bindings apply (only) to the options, parameters, and step names (if any) specified on the command line. For convenience, the prefix “p” is bound to the XProc namespace by default.

Namespaces in the XML configuration are bound by the normal, XML means.

12. Parameter

There are three ways to specify a parameter in the configuration:

Command line (long): --with-param port@name=value
Command line (short): -pport@name=value
XML configuration: <cc:with-param port="portname" name="paramname" value="string"/>

All parameters specified will be bound to either the specified parameter input port or the the primary parameter input port if no explicit port is specified.

13. Input

There are three ways to specify an input binding in the configuration:

Command line (long): --input port=uri
Command line (short): -iport=uri
XML configuration: <cc:input port="portname" href="uri"/>

The input specified must be an XML document. The string “-” may be used for exactly one input URI to bind that input to stdin.

If the input binding for a particular port is repeated, all of the inputs specified will appear on that port as a sequence of documents.

14. Data input

There are two ways to specify a non-XML input binding in the configuration:

Command line (long): --data-input port=uri
Command line (short): -dport=uri

The input specified will be base64 encoded.

T.B.D.

15. Output

There are three ways to specify an output binding in the configuration:

Command line (long): --output port=uri
Command line (short): -oport=uri
XML configuration: <cc:output port="portname" href="uri"/>

The result(s) that appear on the named output port will be written to the specified URI. The string “-” may be used for exactly one output URI to bind that output to stdout.

16. Library

There are two ways to load a library in the configuration:

Command line (long): --library=uri
Command line (short): -luri

The steps in the library loaded are only available in --step options. At most one library may be loaded. If no step name is specified, the first step in the library will be used.

17. Step

There are two ways to load steps in the configuration:

Command line (long): --step=stepname
Command line (short): -sstepname

Steps loaded on the command line may come from the optional library. They must have a single primary input and a single primary output. They are treated as if they appeared sequentially in a p:pipeline.

T.B.D.

18. Pipeline

There are two ways to specify a pipeline in the configuration:

Command line: pipeline-uri
XML configuration: <cc:pipeline>pipeline-uri</cc:pipeline>

The first non-option command line argument is interpreted as the pipeline URI.

T.B.D.

19. Option

There are two ways to specify option values in the configuration:

Command line: name=value
XML configuration: <cc:with-option name="optname" value="string"/>

T.B.D.

20. Step error listener

The step error listener can be specified in the configuration file.

XML configuration: <cc:step-error-listener class-name="classname"/>

T.B.D.

21. Serialization options

All of the XML serialization options can be specified with system properties or specified in the configuration file.

Java system properties: com.xmlcalabash.serial.option=value
XML configuration: <cc:serialization option="value"/>

The option names supported on both system properties and cc:serialization are: byte-order-mark, doctype-public, doctype-system, encoding, escape-uri-attributes, include-content-type, indent, media-type, normalization-form, omit-xml-declaration, standalone, undeclare-prefixes, and version. In addition, the cdata-section-elements option is supported on cc:serialization. (It's only supported in the configuration file because the values are QNames.)

T.B.D.

22. Extension function

Extension functions are specified in the configuration file.

XML configuration: <cc:extenion-function class-name="classname"/>

T.B.D.

23. FO processor

The FO Processor is specified in the configuration file.

XML configuration: <cc:fo-processor class-name="classname"/>

T.B.D.

24. CSS processor

The CSS processor is specified in the configuration file.

XML configuration: <cc:css-processor class-name="classname"/>

T.B.D.

25. XProc configurer

The XProcConfigurer is specified in the configuration file.

XML configuration: <cc:xproc-configurer class-name="classname"/>

T.B.D.

26. Default system property

Default system properties can be specified in the configuration file.

XML configuration: <cc:default-system-property name="property-name" value="default-value"/>

T.B.D.

27. HTML parser

The HTML parser is specified in the configuration file.

XML configuration: <cc:html-parser value="parser"/>

The parser must be “validator.nu” or “tagsoup”.

T.B.D.

28. Saxon configuration property

Saxon configuration properties (Features) can be specified in the configuration file.

XML configuration: <cc:saxon-configuration-property key="key" value="value" type="type"/>

Where “key” is a Saxon FeatureKey and “type” is “integer”, “boolean”, or “string”.

Setting Saxon features through this interface may have unanticipated consequences, use with care.

T.B.D.

29. Send mail configuration

There are two ways to specify the SMTP configuration for sending mail.

Java system properties: com.xmlcalabash.mail-host=hostname
com.xmlcalabash.mail-port=portnumber
com.xmlcalabash.mail-username=name
com.xmlcalabash.mail-password=password
XML configuration: <cc:saxon-configuration-property host="hostname" port="portnumber" username="name" password="password"/>

If you specify a username, you must specify a password, otherwise all the properties are optional. Any unspecified properties will be defaulted by JavaMail to whatever defaults JavaMail uses.

T.B.D.