Package com.saxonica.config
Class EnterpriseTransformerFactory
java.lang.Object
javax.xml.transform.TransformerFactory
javax.xml.transform.sax.SAXTransformerFactory
net.sf.saxon.jaxp.SaxonTransformerFactory
net.sf.saxon.TransformerFactoryImpl
com.saxonica.config.ProfessionalTransformerFactory
com.saxonica.config.EnterpriseTransformerFactory
- All Implemented Interfaces:
Configuration.ApiProvider
- Direct Known Subclasses:
StreamingTransformerFactory
The is the JAXP TransformerFactory implementation for the enterprise
edition of Saxon. It can be invoked by setting the system property
javax.xml.transform.TransformerFactory to the value com.saxonica.EnterpriseTransformerFactory,
and calling TransformerFactory.newInstance(), or it can be instantiated directly.
-
Field Summary
Fields inherited from class javax.xml.transform.sax.SAXTransformerFactory
FEATURE, FEATURE_XMLFILTER -
Constructor Summary
ConstructorsConstructorDescriptionCreate an EnterpriseTransformerFactory.Construct a TransformerFactory using an existing Configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidLoad a schema, which will be available for use by all stylesheets subsequently compiled using this TransformerFactory.newTemplates(Source source) Process the Source into a Templates object, which is a a compiled representation of the source.newTemplates(Source source, CompilerInfo info) Process the Source into a Templates object, which is a a compiled representation of the source.voidsetAttribute(String name, Object value) Allows the user to set specific attributes on the underlying implementation.Methods inherited from class net.sf.saxon.jaxp.SaxonTransformerFactory
getAssociatedStylesheet, getAttribute, getConfiguration, getErrorListener, getFeature, getProcessor, getURIResolver, newTemplatesHandler, newTransformer, newTransformer, newTransformerHandler, newTransformerHandler, newTransformerHandler, newXMLFilter, newXMLFilter, setConfiguration, setErrorListener, setFeature, setURIResolverMethods inherited from class javax.xml.transform.TransformerFactory
newDefaultInstance, newInstance, newInstance
-
Constructor Details
-
EnterpriseTransformerFactory
public EnterpriseTransformerFactory()Create an EnterpriseTransformerFactory. An EnterpriseConfiguration will be created automatically. -
EnterpriseTransformerFactory
Construct a TransformerFactory using an existing Configuration.- Parameters:
config- the configuration to be used. This must be an EnterpriseConfiguration.
-
-
Method Details
-
setAttribute
Allows the user to set specific attributes on the underlying implementation. An attribute in this context is defined to be an option that the implementation provides.- Overrides:
setAttributein classProfessionalTransformerFactory- Parameters:
name- The name of the attribute. This must be one of the constants defined in classFeatureKeys.value- The value of the attribute.- Throws:
IllegalArgumentException- thrown if Saxon doesn't recognize the attribute.- See Also:
-
addSchema
Load a schema, which will be available for use by all stylesheets subsequently compiled using this TransformerFactory.If this method is called more than once, the resulting schema will be the union of all schemas supplied. This union must be a valid schema in its own right. This means, for example, that two schemas supplied via this interface must not contain duplicate type definitions.
- Parameters:
schemaSource- the JAXP Source object identifying the schema document to be loaded- Throws:
TransformerException- if the schema cannot be read or parsed or if it is invalid
-
newTemplates
Process the Source into a Templates object, which is a a compiled representation of the source. This Templates object may then be used concurrently across multiple threads. Creating a Templates object allows the TransformerFactory to do detailed performance optimization of transformation instructions, without penalizing runtime transformation.- Overrides:
newTemplatesin classSaxonTransformerFactory- Parameters:
source- An object that holds a URL, input stream, etc.- Returns:
- A Templates object capable of being used for transformation purposes, never null.
- Throws:
TransformerConfigurationException- May throw this during the parse when it is constructing the Templates object and fails.
-
newTemplates
public Templates newTemplates(Source source, CompilerInfo info) throws TransformerConfigurationException Process the Source into a Templates object, which is a a compiled representation of the source. This Templates object may then be used concurrently across multiple threads. Creating a Templates object allows the TransformerFactory to do detailed performance optimization of transformation instructions, without penalizing runtime transformation.- Overrides:
newTemplatesin classSaxonTransformerFactory- Parameters:
source- An object that holds a URL, input stream, etc.info- compile-time options for this stylesheet compilation- Returns:
- A Templates object capable of being used for transformation purposes, never null.
- Throws:
TransformerConfigurationException- May throw this during the parse when it is constructing the Templates object and fails.
-