<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="changes" page="intro93" subpage="command-line-93"/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Command line and configuration changes</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: Command line and configuration changes"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>Command line and configuration changes</h1>
      <p>The code for the <code>net.sf.saxon.Transform</code> and <code>net.sf.saxon.Query</code> command line interfaces has been refactored. 
                  Impact: (a) some legacy options are no longer supported 
(for example, <code>-ds</code>,<code> -dt</code>, and the ability to separate keyword from value using a space rather than a colon, e.g. "<code>-o output.html</code>"). (b) <code>-opt:?</code>
now requests help on that particular option, (c) options that were previously freestanding now accept "on" as a value, e.g. <code>-t</code> can be
written <code>-t:on</code>.</p>
      <p>A new option <code>-init:initializer</code> is available on all command line interfaces. The value is the name of a user-supplied class
            that implements the interface <a class="bodylink" href="../../javadoc/net/sf/saxon/lib/Initializer.html"><code>net.sf.saxon.lib.Initializer</code></a>; 
                  this initializer will be called during the initialization process,
                  and may be used to set any options required on the <a class="bodylink" href="../../javadoc/net/sf/saxon/Configuration.html"><code>Configuration</code></a> 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.</p>
      <p>On the <code>Transform</code> command line interface, the <code>-traceout</code> option now governs the destination of trace output from the standard 
                  <a class="bodylink" href="../../javadoc/net/sf/saxon/lib/TraceListener.html"><code>TraceListener</code></a> (-T option) as well as from the <code>trace()</code> function.
                  The <code>-TP</code> option (for timing profile information) is extended
so a filename can be specified: <code>-TP:filename</code>.</p>
      <p>On the <code>Transform</code> command line interface, the option <code>-xsltversion:2.0</code> or <code>-xsltversion:3.0</code> 
                  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 <code>-xsltversion:0.0</code> indicates that this decision
should be made based on the <code>version</code> attribute of the <code>xsl:stylesheet</code> element. Similar options to set the
XSLT processor version are available in the <a class="bodylink" href="../../javadoc/net/sf/saxon/s9api/XsltCompiler.html"><code>XsltCompiler</code></a> class (s9api on Java, Saxon.Api on .NET), 
and via new options in <a class="bodylink" href="../../javadoc/net/sf/saxon/lib/FeatureKeys.html"><code>FeatureKeys</code></a> and in the configuration file.</p>
      <p>The <code>com.saxonica.Validate</code> interface accepts some additional options as a result of these changes:
                  <code>-dtd</code>, <code>-ext</code>, <code>-opt</code>, <code>-y</code>. The option <code>-xsdversion</code>
         was already accepted, but not documented.</p>
      <p>The <code>com.saxonica.Validate</code> interface has a new option <code>-stats:filename</code> 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.)</p>
      <p>The command <code>com.saxonica.CompileStylesheet</code> now uses the <code>-key:value</code> argument style throughout. 
                  It now accepts a <code>-config:filename</code> argument. The compiled stylesheet output may be specified using
<code>-csout:filename</code></p>
      <p>All commands now accept <code>--F:value</code> where F is the name of a string defined in <a class="bodylink" href="../../configuration/config-features.xml">FeatureKeys</a> 
                  (the part after <code>"http://saxon.sf.net/feature/"</code>), and
value is the string value of the feature; or <code>--F</code> as a synonym for <code>--F:true</code>.</p>
      <p>Most places in the code that previously wrote to <code>System.err</code>, or that used <code>System.err</code> as a default destination,
now default instead to using <a class="bodylink"
            href="../../javadoc/net/sf/saxon/Configuration.html#getStandardErrorOutput"><code>Configuration.getStandardErrorOutput()</code></a>.
                  This can be set to a different destination by calling
                  <a class="bodylink"
            href="../../javadoc/net/sf/saxon/Configuration.html#setStandardErrorOutput"><code>Configuration.setStandardErrorOutput()</code></a>
                           (which expects a <code>PrintStream</code>), or by setting the write-only configuration property
                           <a class="bodylink"
            href="../../javadoc/net/sf/saxon/lib/FeatureKeys.html#STANDARD_ERROR_OUTPUT_FILE"><code>FeatureKeys.STANDARD_ERROR_OUTPUT_FILE</code></a> 
                           (which expects a filename, which will be appended to). 
In the configuration file the corresponding setting
is <code>global/@standardErrorOutputFile</code>. Note that this only redirects Saxon output; other application
output written to <code>System.err</code> is unaffected. Output written directly by command-line interfaces such as <code>net.sf.saxon.Transform</code>
is unaffected. Examples of affected output are the default destination of the <code>ErrorListener</code>; the default destination for <code>TraceListener</code> 
                           and <code>xsl:message</code>
output; the default destination for optimizer tracing and "explain" output.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="extensibility-93.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>