The Controller is Saxon's implementation of the JAXP Transformer class, and represents an executing instance of a transformation or query. Multiple concurrent executions of the same transformation or query will use different Controller instances. This class is therefore not thread-safe.
The Controller is serially reusable, as required by JAXP: when one transformation or query is finished, it can be used to run another. However, there is no advantage in doing this rather than allocating a new Controller each time.
The Controller can also be used when running Java applications that use neither XSLT nor XQuery. A dummy Controller is created when running free-standing XPath expressions.
The Controller holds those parts of the dynamic context that do not vary during the course of a transformation or query, or that do not change once their value has been computed. This also includes those parts of the static context that are required at run-time.
Wherever possible XSLT applications should use the JAXP Transformer class directly, rather than relying on Saxon-specific methods in the Controller. However, some features are currently available only through this class. This applies especially to new features specific to XSLT 2.0, since the JAXP interface still supports only XSLT 1.0. Such methods may be superseded in the future by JAXP methods.
Many methods on the Controller are designed for internal use and should not be considered stable. From release 8.4 onwards, those methods that are considered sufficiently stable to constitute path of the Saxon public API are labelled with the JavaDoc tag "since": the value indicates the release at which the method was added to the public API.
@author Michael H. Kay
@since 8.4