Configuration using s9api
In Saxon's s9api interface the root API object is the net.sf.saxon.s9api.Processor
object. This again is a wrapper around a Configuration. All the configuration properties
are exposed via the Processor
methods getConfigurationProperty(name)
and setConfigurationProperty(name,
value)
which map directly to the same methods on the underlying Configuration
.
The s9api Processor
object also has a constructor new Processor(source)
which allows the underlying
Configuration
to be built from a supplied configuration file. The argument is a org.xml.sax.Source
object, for example
a StreamSource
, which identifies the configuration file, which must have the format described in Configuration file.
In many cases with s9api it is more appropriate to set options at a finer level of granularity than the Processor
. For example, options
that affect XSLT stylesheet compilation can be set on the XsltCompiler object, and
options that affect XQuery compilation on the XQueryCompiler. Some more specialized
configuration options are not exposed directly by these two classes, but can be tailored by accessing the underlying support objects: CompilerInfo in the case of XSLT, and StaticQueryContext in the case of XQuery.