Class TransformerImpl
Since Saxon 9.6, JAXP interfaces are implemented as a layer above the s9api interface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear all parameters set with setParameter.Get the internal Saxon Controller instance that implements this transformation.Get the underlying s9api implementation class wrapped by this JAXP TransformerCreate a JAXP TransformerHandler to perform the transformationCreate a JAXP XMLFilter which allows this transformation to be added to a SAX pipelinevoidreset()Reset thisTransformerto its original configuration.protected voidsetConvertedParameter(QName name, XdmValue value) voidsetErrorListener(ErrorListener listener) Set the error event listener in effect for the transformation.voidsetInitialMode(String name) Supply an initial mode for a transformation.voidsetInitialTemplate(String name) Supply an initial template for a transformation.voidsetURIResolver(URIResolver resolver) Set an object that will be used to resolve URIs used in document().voidTransform the XMLSourceto aResult.Methods inherited from class net.sf.saxon.jaxp.AbstractTransformerImpl
getParameter, getStylesheetOutputProperties, getUnderlyingXsltExecutable, makeDestination, setParameterMethods inherited from class net.sf.saxon.jaxp.IdentityTransformer
getConfiguration, getErrorListener, getLocalOutputProperties, getOutputProperties, getOutputProperty, getURIResolver, reportFatalError, setOutputProperties, setOutputProperty
-
Constructor Details
-
TransformerImpl
-
-
Method Details
-
transform
Transform the XML
Sourceto aResult. Specific transformation behavior is determined by the settings of theTransformerFactoryin effect when theTransformerwas instantiated and any modifications made to theTransformerinstance.An empty
Sourceis represented as an empty document as constructed byDocumentBuilder.newDocument(). The result of transforming an emptySourcedepends on the transformation behavior; it is not always an emptyResult.- Overrides:
transformin classIdentityTransformer- Parameters:
xmlSource- The XML input to transform.outputTarget- TheResultof transforming thexmlSource.- Throws:
XPathException- If an unrecoverable error occurs during the course of the transformation.
-
setConvertedParameter
- Specified by:
setConvertedParameterin classAbstractTransformerImpl
-
clearParameters
public void clearParameters()Clear all parameters set with setParameter.- Overrides:
clearParametersin classAbstractTransformerImpl
-
setURIResolver
Set an object that will be used to resolve URIs used in document().If the resolver argument is null, the URIResolver value will be cleared and the transformer will no longer have a resolver.
- Overrides:
setURIResolverin classIdentityTransformer- Parameters:
resolver- An object that implements the URIResolver interface, or null.
-
setErrorListener
Set the error event listener in effect for the transformation.- Overrides:
setErrorListenerin classIdentityTransformer- Parameters:
listener- The new error listener.- Throws:
IllegalArgumentException- if listener is null.
-
setInitialTemplate
Supply an initial template for a transformation.This is a Saxon extension to the JAXP interface, needed for XSLT 2.0
Changed in 9.9 so it no longer validates the supplied name; an incorrect name will lead to an error later.
- Parameters:
name- the name of the initial template, in Clark notation (either a local name, or "{uri}local")
-
setInitialMode
Supply an initial mode for a transformation.This is a Saxon extension to the JAXP interface, needed for XSLT 2.0
- Parameters:
name- the name of the initial mode, in Clark notation (either a local name, or "{uri}local")- Throws:
IllegalArgumentException- if the argument is invalid, for example if the format of the name is incorrect or if there is no mode with this name
-
getUnderlyingXsltTransformer
Get the underlying s9api implementation class wrapped by this JAXP Transformer- Returns:
- the underlying s9api XsltTransformer
-
getUnderlyingController
Get the internal Saxon Controller instance that implements this transformation. Note that the Controller interface will not necessarily remain stable in future releases- Specified by:
getUnderlyingControllerin classAbstractTransformerImpl- Returns:
- the underlying Saxon Controller instance
-
newTransformerHandler
Create a JAXP TransformerHandler to perform the transformation- Returns:
- a JAXP TransformerHandler, which allows the transformation to be performed in "push" mode on a SAX pipeline.
-
newXMLFilter
Create a JAXP XMLFilter which allows this transformation to be added to a SAX pipeline- Specified by:
newXMLFilterin classAbstractTransformerImpl- Returns:
- the transformation in the form of an XMLFilter
-
reset
public void reset()Description copied from class:IdentityTransformerReset this
Transformerto its original configuration.Transformeris reset to the same state as when it was created withTransformerFactory.newTransformer(),TransformerFactory.newTransformer(javax.xml.transform.Source source)orTemplates.newTransformer().reset()is designed to allow the reuse of existingTransformers thus saving resources associated with the creation of newTransformers.The reset
Transformeris not guaranteed to have the sameURIResolverorErrorListenerObjects, e.g.Object.equals(Object obj). It is guaranteed to have a functionally equalURIResolverandErrorListener.- Overrides:
resetin classIdentityTransformer
-