# JAXP Factory Interfaces

Saxon implements a number of JAXP interfaces, notably the APIs for transformation, XPath processing, and validation.

For transformation, the root object of the API is the JAXP `TransformerFactory`. Saxon provides three implementations of this interface: `net.sf.saxon.TransformerFactoryImpl` for Saxon-HE, and `com.saxonica.config.ProfessionalTransformerFactory` and `com.saxonica.config.EnterpriseTransformerFactory` for Saxon-PE and Saxon-EE respectively. This interface provides methods `getAttribute(name)` and `setAttribute(name, value)` which correspond directly to the methods `getConfigurationProperty(name)` and `setConfigurationProperty(name, value)` on the underlying `Configuration` object. By casting from the JAXP interface to the Saxon implementation class it is also possible to call the `getConfiguration` method which exposes the `Configuration` object directly.

The Saxon-PE and Saxon-EE implementations of the `TransformerFactory` also allow the configuration property `FeatureKeys.CONFIGURATION_FILE` to be set. The value is a filename containing the name of a configuration file, which must have the format described in Configuration file. This causes any previously-initialized configuration to be discarded, and replaced with a new `Configuration` object built from the settings in the specified configuration file.

The JAXP `XPathFactory` interface unfortunately lacks a similar general-purpose configuration mechanism, so it is necessary to navigate to the underlying `Configuration` object and use its native interfaces. Saxon's implementation class for the `XPathFactory` is `net.sf.saxon.xpath.XPathFactoryImpl`, regardless which Saxon edition is in use. Note that although Saxon implements the JAXP XPath API, it is rarely possible to use it in a way that has no dependencies on the Saxon implementation, partly because of the requirement for all Saxon tasks to run under the same `Configuration`. When using the XPath API, therefore, the `Configuration` object is usually exposed to the application.

Saxon-EE also implements the JAXP `SchemaFactory` in class `com.saxonica.jaxp.SchemaFactoryImpl`. The interface offers methods `getProperty(name)` and `setProperty(name, value)` which map to the underlying methods in the Saxon `Configuration`; again, it is also possible to cast to the Saxon implementation class and call configuration-setting methods directly.

Next