public class TransformerImpl extends IdentityTransformer
Since Saxon 9.6, JAXP interfaces are implemented as a layer above the s9api interface
Modifier | Constructor and Description |
---|---|
protected |
TransformerImpl(XsltExecutable e,
XsltTransformer t) |
Modifier and Type | Method and Description |
---|---|
void |
clearParameters()
Clear all parameters set with setParameter.
|
Object |
getParameter(String name)
Get a parameter that was explicitly set with setParameter.
|
protected Properties |
getStylesheetOutputProperties()
Get the output properties defined in the unnamed xsl:output declaration(s) within
the stylesheet
|
Controller |
getUnderlyingController()
Get the internal Saxon Controller instance that implements this transformation.
|
XsltExecutable |
getUnderlyingXsltExecutable()
Get the underlying s9api implementation class representing the compled stylesheet
which this transformer is executing
|
XsltTransformer |
getUnderlyingXsltTransformer()
Get the underlying s9api implementation class wrapped by this JAXP Transformer
|
TransformerHandler |
newTransformerHandler()
Create a JAXP TransformerHandler to perform the transformation
|
XMLFilter |
newXMLFilter()
Create a JAXP XMLFilter which allows this transformation to be added to a SAX pipeline
|
void |
setErrorListener(ErrorListener listener)
Set the error event listener in effect for the transformation.
|
void |
setInitialMode(String name)
Supply an initial mode for a transformation.
|
void |
setInitialTemplate(String name)
Supply an initial template for a transformation.
|
void |
setParameter(String name,
Object value)
Add a parameter for the transformation.
|
void |
setURIResolver(URIResolver resolver)
Set an object that will be used to resolve URIs used in
document().
|
void |
transform(Source xmlSource,
Result outputTarget)
Transform the XML
Source to a Result . |
getConfiguration, getErrorListener, getLocalOutputProperties, getOutputProperties, getOutputProperty, getURIResolver, reportFatalError, reset, setOutputProperties, setOutputProperty
protected TransformerImpl(XsltExecutable e, XsltTransformer t)
public void transform(Source xmlSource, Result outputTarget) throws XPathException
Transform the XML Source
to a Result
.
Specific transformation behavior is determined by the settings of the
TransformerFactory
in effect when the
Transformer
was instantiated and any modifications made to
the Transformer
instance.
An empty Source
is represented as an empty document
as constructed by DocumentBuilder.newDocument()
.
The result of transforming an empty Source
depends on
the transformation behavior; it is not always an empty
Result
.
transform
in class IdentityTransformer
xmlSource
- The XML input to transform.outputTarget
- The Result
of transforming the
xmlSource
.TransformerException
- If an unrecoverable error occurs
during the course of the transformation.XPathException
public void setParameter(String name, Object value)
Pass a qualified name as a two-part string, the namespace URI enclosed in curly braces ({}), followed by the local name. If the name has a null URL, the String only contain the local name. An application can safely check for a non-null URI by testing to see if the first character of the name is a '{' character.
For example, if a URI and local name were obtained from an element defined with <xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/>, then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that no prefix is used.
setParameter
in class IdentityTransformer
name
- The name of the parameter, which may begin with a
namespace URI in curly braces ({}).value
- The value object. This can be any valid Java object. It is
up to the processor to provide the proper object coersion or to simply
pass the object on for use in an extension.NullPointerException
- If value is null.IllegalArgumentException
- If the supplied value cannot be converted to the declared
type of the corresponding stylesheet parameterpublic Object getParameter(String name)
This method does not return a default parameter value, which cannot be determined until the node context is evaluated during the transformation process.
getParameter
in class IdentityTransformer
name
- of Object
to getpublic void clearParameters()
clearParameters
in class IdentityTransformer
public void setURIResolver(URIResolver resolver)
If the resolver argument is null, the URIResolver value will be cleared and the transformer will no longer have a resolver.
setURIResolver
in class IdentityTransformer
resolver
- An object that implements the URIResolver interface,
or null.public void setErrorListener(ErrorListener listener) throws IllegalArgumentException
setErrorListener
in class IdentityTransformer
listener
- The new error listener.IllegalArgumentException
- if listener is null.public void setInitialTemplate(String name) throws IllegalArgumentException
This is a Saxon extension to the JAXP interface, needed for XSLT 2.0
name
- the name of the initial template, in Clark notation (either a local name,
or "{uri}local")IllegalArgumentException
- if the argument is invalid, for example if the
format of the name is incorrect or if there is no template with this namepublic void setInitialMode(String name) throws IllegalArgumentException
This is a Saxon extension to the JAXP interface, needed for XSLT 2.0
name
- the name of the initial mode, in Clark notation (either a local name,
or "{uri}local")IllegalArgumentException
- if the argument is invalid, for example if the
format of the name is incorrect or if there is no mode with this nameprotected Properties getStylesheetOutputProperties()
getStylesheetOutputProperties
in class IdentityTransformer
public XsltTransformer getUnderlyingXsltTransformer()
public XsltExecutable getUnderlyingXsltExecutable()
public Controller getUnderlyingController()
public TransformerHandler newTransformerHandler()
public XMLFilter newXMLFilter()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.