Command line interfaces
The code for the
net.sf.saxon.Query command line interfaces has been refactored.
Impact: (a) some legacy options are no longer supported
-dt, and the ability to separate keyword from value using a space rather than a colon, e.g. "
-o output.html"). (b)
now requests help on that particular option, (c) options that were previously freestanding now accept "on" as a value, e.g.
-t can be
A new option
-init:initializer is available on all command line interfaces. The value is the name of a user-supplied class
that implements the interface net.sf.saxon.lib.Initializer;
this initializer will be called during the initialization process,
and may be used to set any options required on the Configuration programmatically.
It is particularly useful for such tasks as
registering extension functions, collations, or external object models, especially in Saxon-HE where the option does not exist to
do this via a configuration file. Saxon only calls the initializer when running from the command line, but of course the same code
may be invoked to perform initialization when running user application code.
Transform command line interface, the
-traceout option now governs the destination of trace output from the standard
TraceListener (-T option) as well as from the
-TP option (for timing profile information) is extended
so a filename can be specified:
Transform command line interface, the option
indicates whether the XSLT processor
should implement the XSLT 2.0 specification or the XSLT 3.0 (also known as 2.1) specification. The default value
-xsltversion:0.0 indicates that this decision
should be made based on the
version attribute of the
xsl:stylesheet element. Similar options to set the
XSLT processor version are available in the XsltCompiler class (s9api on Java, Saxon.Api on .NET),
and via new options in FeatureKeys and in the configuration file.
com.saxonica.Validate interface accepts some additional options as a result of these changes:
-y. The option
was already accepted, but not documented.
com.saxonica.Validate interface has a new option
-stats:filename which produces an output document showing which
schema components were used during the validation, and how often. The output is in XML, allowing further processing
to produce profiles and coverage reports for the schema. (There are corresponding internal APIs that allow the same effect
when validation is invoked from an application, but they are not currently exposed through s9api.)
com.saxonica.CompileStylesheet now uses the
-key:value argument style throughout.
It now accepts a
-config:filename argument. The compiled stylesheet output may be specified using
All commands now accept
--F:value where F is the name of a string defined in FeatureKeys
(the part after
value is the string value of the feature; or
--F as a synonym for
Most places in the code that previously wrote to
System.err, or that used
System.err as a default destination,
now default instead to using
This can be set to a different destination by calling
(which expects a
PrintStream), or by setting the write-only configuration property
(which expects a filename, which will be appended to).
In the configuration file the corresponding setting
global/@standardErrorOutputFile. Note that this only redirects Saxon output; other application
output written to
System.err is unaffected. Output written directly by command-line interfaces such as
is unaffected. Examples of affected output are the default destination of the
ErrorListener; the default destination for
output; the default destination for optimizer tracing and "explain" output.