<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="configuration" page="config-interfaces" subpage=""/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: Configuration interfaces</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: Configuration interfaces"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>Configuration interfaces</h1>
      <p>At the heart of Saxon is the object <a class="bodylink" href="../javadoc/net/sf/saxon/Configuration.html"><code>net.sf.saxon.Configuration</code></a>. This contains all the current settings
         of configuration options. All Saxon tasks, such as compiling and running queries and transformations, or building and
         validating source documents, happen under the control of a <code>Configuration</code>. Many resources are owned
         by the <code>Configuration</code>, meaning that related tasks must run under the same <code>Configuration</code>.
         Most notably, the <code>Configuration</code> holds a <a class="bodylink" href="../javadoc/net/sf/saxon/om/NamePool.html"><code>NamePool</code></a>, which is a table allocating integer
       codes to the qualified names that appear in stylesheets, queries, schemas, and source documnets, and during the execution
      of a stylesheet or query all the resources used (for example, the stylesheet, all its input documents, and any schemas
      it uses) must all use the same <code>NamePool</code> to ensure that they all use the same integer codes for the same
      qualified names. However, two Saxon tasks that are unrelated can run under different <code>Configuration</code>s.</p>
      <p>There are subclasses of <code>Configuration</code> containing resources associated with the capabilities of the
      different Saxon editions: specifically, <a class="bodylink"
            href="../javadoc/com/saxonica/config/ProfessionalConfiguration.html"><code>com.saxonica.config.ProfessionalConfiguration</code></a> and
      <a class="bodylink"
            href="../javadoc/com/saxonica/config/EnterpriseConfiguration.html"><code>com.saxonica.config.EnterpriseConfiguration</code></a>. In many cases the <code>Configuration</code> is used
      as a factory class to deliver services associated with the different capability levels, for example the
         method <code>getOptimizer()</code> returns the query optimizer appropriate to the loaded Saxon edition.</p>
      <p>Many configuration options have direct setter and getter methods on the <code>Configuration</code> object,
      for example <code>setAllowExternalFunctions()</code> and <code>isAllowExternalFunctions()</code>. Some other options
      have setters and getters on objects reachable from the <code>Configuration</code>, for example defaults for XSLT
         processing can be controlled using methods such as <code>getDefaultXsltCompilerInfo().setXsltVersion()</code>,
      while defaults for XQuery processing can be controlled using methods such as 
         <code>getDefaultStaticQueryContext().setLanguageVersion()</code>.</p>
      <p>The most general mechanism for getting and setting configuration properties, however, is provided by the methods
         <code>getConfigurationProperty(name)</code> and <code>setConfigurationProperty(name, value)</code>. In these methods
         the name of the configuration property is always a string in the form of a URI (for example,
         <code>"http://saxon.sf.net/feature/initialTemplate"</code>), and the strings available are all defined by constants in the
         class <a class="bodylink" href="../javadoc/net/sf/saxon/lib/FeatureKeys.html"><code>net.sf.saxon.lib.FeatureKeys</code></a> (for example, <code>FeatureKeys.INITIAL_TEMPLATE</code>).
         The value is of various types depending on the property. In the vast majority of cases, the property
         can be supplied as a string, or it has an alternative, equivalent property that can be supplied as a string.
         For properties that are essentially boolean in nature the value can be supplied either as one of the Java constants
         <code>Boolean.TRUE</code> or <code>Boolean.FALSE</code>, or as one of the strings "true", "1", "yes", "on", or
         "false", "0", "no", "off". These choices are designed to suit the conventions of different APIs in which the
         configuration options are exposed.</p>
      <p>In many APIs for controlling Saxon activities, the <code>Configuration</code> object is not exposed
      directly, but is hidden below some similar object acting as the root object for that particular API. Many
      of these objects provide a direct way to set the configuration options. These are discussed in the following 
      sections.</p>
      <ul>
         <li>
            <p><a class="bodylink" href="config-interfaces/jaxp-configuration.xml">JAXP Factory Interfaces</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="config-interfaces/s9api-config.xml">Configuration using s9api</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="config-interfaces/config-dotnet.xml">Configuration using the .NET API</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="config-interfaces/config-commandline.xml">Configuration from the command line</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="config-interfaces/config-xqj.xml">Configuration using XQJ</a></p>
         </li>
         <li>
            <p><a class="bodylink" href="config-interfaces/config-ant.xml">Configuration when running Ant</a></p>
         </li>
      </ul>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="config-interfaces/jaxp-configuration.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>