<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="configuration" page="configuration-file" subpage=""/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: The Saxon configuration file</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: The Saxon configuration file"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>The Saxon configuration file</h1>
      <p><i>This facility is not available in Saxon-HE (home edition)</i></p>
      <p>Configuration parameters for Saxon can be defined in a configuration file. This file is optional.
It can be applied by using the option <code>-config:filename</code> on the <code>Transform</code>,
<code>Query</code>, or <code>Validate</code> command line, or using the factory method 
<code>Configuration.readConfiguration()</code>.</p>
      <p>In both the s9api interface on Java, and the Saxon.Api interface on .NET, there is a constructor on the
  <code>Processor</code> class that
takes a configuration file as input.</p>
      <p>Here is an example configuration file. It is designed to show as many options as possible; in practice,
no option needs to be included if it is to take its default value, and it is probably good practice to only
include those parameters that you need to specify explicitly. Some of the example values used in this sample
will not work unless you have files with the relevant names at particular locations, or unless you have classes
with particular names available on your classpath; if such entries cause problems, you can always delete them.</p>
      <div class="codeblock"
           style="border: solid thin; background-color: #B1CCC7; padding: 2px">
         <pre>
            <code>
&lt;configuration xmlns="http://saxon.sf.net/ns/configuration"
               edition="EE"&gt;
  &lt;global
    allowExternalFunctions="true"
    allowMultiThreading="true"
    allowOldJavaUriFormat="false"
    collationUriResolver="net.sf.saxon.lib.StandardCollationURIResolver"
    collectionUriResolver="net.sf.saxon.lib.StandardCollectionURIResolver"
    compileWithTracing="false"
    defaultCollation="http://www.w3.org/2005/xpath-functions/collation/codepoint"
    defaultCollection="file:///e:/temp"
    dtdValidation="false"
    dtdValidationRecoverable="true"
    errorListener="net.sf.saxon.StandardErrorListener"
    expandAttributeDefaults="true"
    lazyConstructionMode="false"
    lineNumbering="true"
    optimizationLevel="10"
    preEvaluateDocFunction="false"
    preferJaxpParser="true"
    recognizeUriQueryParameters="true"
    schemaValidation="strict"
    serializerFactory=""
    sourceParser=""
    sourceResolver=""
    stripWhitespace="all"
    styleParser=""
    timing="false"
    traceExternalFunctions="true"
    traceListener="net.sf.saxon.trace.XSLTTraceListener"
    traceOptimizerDecisions="false"
    treeModel="tinyTreeCondensed"
    uriResolver="net.sf.saxon.StandardURIResolver"
    usePiDisableOutputEscaping="false"
    useTypedValueCache="true"
    validationComments="false"
    validationWarnings="true"
    versionOfXml="1.0"
    xInclude="false"
  /&gt;

  &lt;xslt
    initialMode=""
    initialTemplate=""
    messageReceiver=""
    outputUriResolver=""
    recoveryPolicy="recoverWithWarnings"
    schemaAware="false"
    staticErrorListener=""
    staticUriResolver=""
    styleParser=""
    version="2.1"
    versionWarning="false"&gt;
    &lt;extensionElement namespace="http://saxon.sf.net/sql" 
        factory="net.sf.saxon.option.sql.SQLElementFactory"/&gt;
  &lt;/xslt&gt;

  &lt;xquery
    allowUpdate="true"
    constructionMode="preserve"
    defaultElementNamespace=""
    defaultFunctionNamespace="http://www.w3.org/2005/xpath-functions"
    emptyLeast="true"
    inheritNamespaces="true"
    moduleUriResolver="net.sf.saxon.query.StandardModuleURIResolver"
    preserveBoundarySpace="false"
    preserveNamespaces="true"
    requiredContextItemType="document-node()"
    schemaAware="false"
    staticErrorListener=""
    version="1.1"
    /&gt;
    
  &lt;xsd
    occurrenceLimits="100,250"
    schemaUriResolver="com.saxonica.sdoc.StandardSchemaResolver"
    useXsiSchemaLocation="false"
    version="1.1"
  /&gt;
  
  &lt;serialization
    method="xml"
    indent="yes"
    saxon:indent-spaces="8"
    xmlns:saxon="http://saxon.sf.net/"/&gt;
    
  &lt;localizations defaultLanguage="en" defaultCountry="US"&gt;
    &lt;localization lang="da" class="net.sf.saxon.option.local.Numberer_da"/&gt;
    &lt;localization lang="de" class="net.sf.saxon.option.local.Numberer_de"/&gt;
  &lt;/localizations&gt;
  
  &lt;resources&gt;
    &lt;externalObjectModel&gt;net.sf.saxon.option.xom.XOMObjectModel&lt;/externalObjectModel&gt;
    &lt;extensionFunction&gt;s9apitest.TestIntegrationFunctions$SqrtFunction&lt;/extensionFunction&gt;
    &lt;schemaDocument&gt;file:///c:/MyJava/samples/data/books.xsd&lt;/schemaDocument&gt;
    &lt;schemaComponentModel/&gt;
  &lt;/resources&gt;
  
  &lt;collations&gt;
    &lt;collation uri="http://www.w3.org/2005/xpath-functions/collation/codepoint" 
               class="net.sf.saxon.sort.CodepointCollator"/&gt;
    &lt;collation uri="http://www.microsoft.com/collation/caseblind" 
               class="net.sf.saxon.sort.CodepointCollator"/&gt;
    &lt;collation uri="http://example.com/french" lang="fr" ignore-case="yes"/&gt;
  &lt;/collations&gt;  
&lt;/configuration&gt;
</code>
         </pre>
      </div>
      <p>The <code>configuration</code> element takes a single attribute, <code>edition</code>, whose value indicates
the Saxon edition in use: HE (home edition), PE (professional edition), or EE (enterprise edition). The default value
is HE. If PE or EE is specified, then the appropriate license file must be installed.</p>
      <p>The children of the <code>configuration</code> element may appear in any order.</p>
      <p>The contents of the different sections of the configuration file are described in the following subsections.</p>
      <ul>
         <li>
            <p><a class="bodylink" href="configuration-file/config-global.xml">The &lt;global&gt; element</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="configuration-file/config-xslt.xml">The &lt;xslt&gt; element</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="configuration-file/config-xquery.xml">The &lt;xquery&gt; element</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="configuration-file/config-xsd.xml">The &lt;xsd&gt; element</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="configuration-file/config-resources.xml">The &lt;resources&gt; element</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="configuration-file/config-collations.xml">The &lt;collations&gt; element</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="configuration-file/config-localizations.xml">The &lt;localizations&gt; element</a></p>
         </li>
      </ul>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="configuration-file/config-global.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>