Class StreamingTransformerImpl
- java.lang.Object
- 
- javax.xml.transform.Transformer
- 
- net.sf.saxon.jaxp.IdentityTransformer
- 
- net.sf.saxon.jaxp.StreamingTransformerImpl
 
 
 
- 
 public class StreamingTransformerImpl extends IdentityTransformer Saxon implementation of the JAXP Transformer interface. This implementation of Transformer is used when the factory is aStreamingTransformerFactory, and the effect is that thetransform(Source, Result)method accepts a StreamSource or SAXSource and processes it in streaming mode, assuming that the initial mode is labelled withstreamable="yes". The global context item in such a transformation will be absent, so referring to "." within a global variable is an error.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classStreamingTransformerImpl.StreamingTransformerHandler
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedStreamingTransformerImpl(XsltExecutable e, Xslt30Transformer t)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearParameters()Clear all parameters set with setParameter.java.lang.ObjectgetParameter(java.lang.String name)Get a parameter that was explicitly set with setParameter.protected java.util.PropertiesgetStylesheetOutputProperties()Get the output properties defined in the unnamed xsl:output declaration(s) within the stylesheetControllergetUnderlyingController()Get the internal Saxon Controller instance that implements this transformation.XsltExecutablegetUnderlyingXsltExecutable()Get the underlying s9api implementation class representing the compled stylesheet which this transformer is executingXslt30TransformergetUnderlyingXsltTransformer()Get the underlying s9api implementation class wrapped by this JAXP Transformerjavax.xml.transform.sax.TransformerHandlernewTransformerHandler()Get a TransformerHandler that can be used to run the transformation by feeding in SAX eventsorg.xml.sax.XMLFilternewXMLFilter()Create a JAXP XMLFilter which allows this transformation to be added to a SAX pipelineprotected voidsetConvertedParameter(QName name, XdmValue value)voidsetErrorListener(javax.xml.transform.ErrorListener listener)Set the error event listener in effect for the transformation.voidsetInitialMode(java.lang.String name)Supply an initial mode for a transformation.voidsetParameter(java.lang.String name, java.lang.Object value)Add a parameter for the transformation.voidsetURIResolver(javax.xml.transform.URIResolver resolver)Set an object that will be used to resolve URIs used in document().voidtransform(javax.xml.transform.Source xmlSource, javax.xml.transform.Result outputTarget)Transform the XMLSourceto aResult.- 
Methods inherited from class net.sf.saxon.jaxp.IdentityTransformergetConfiguration, getErrorListener, getLocalOutputProperties, getOutputProperties, getOutputProperty, getURIResolver, reportFatalError, reset, setOutputProperties, setOutputProperty
 
- 
 
- 
- 
- 
Constructor Detail- 
StreamingTransformerImplprotected StreamingTransformerImpl(XsltExecutable e, Xslt30Transformer t) 
 
- 
 - 
Method Detail- 
transformpublic void transform(javax.xml.transform.Source xmlSource, javax.xml.transform.Result outputTarget) throws XPathExceptionTransform 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 class- IdentityTransformer
- Parameters:
- xmlSource- The XML input to transform.
- outputTarget- The- Resultof transforming the- xmlSource.
- Throws:
- XPathException- If an unrecoverable error occurs during the course of the transformation.
 
 - 
clearParameterspublic void clearParameters() Clear all parameters set with setParameter.
 - 
setURIResolverpublic void setURIResolver(javax.xml.transform.URIResolver resolver) 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 class- IdentityTransformer
- Parameters:
- resolver- An object that implements the URIResolver interface, or null.
 
 - 
setErrorListenerpublic void setErrorListener(javax.xml.transform.ErrorListener listener) throws java.lang.IllegalArgumentExceptionSet the error event listener in effect for the transformation.- Overrides:
- setErrorListenerin class- IdentityTransformer
- Parameters:
- listener- The new error listener.
- Throws:
- java.lang.IllegalArgumentException- if listener is null.
 
 - 
setInitialModepublic void setInitialMode(java.lang.String name) throws java.lang.IllegalArgumentExceptionSupply 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:
- java.lang.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
 
 - 
getUnderlyingXsltTransformerpublic Xslt30Transformer getUnderlyingXsltTransformer() Get the underlying s9api implementation class wrapped by this JAXP Transformer- Returns:
- the underlying s9api XsltTransformer
 
 - 
getUnderlyingControllerpublic Controller getUnderlyingController() Get the internal Saxon Controller instance that implements this transformation. Note that the Controller interface will not necessarily remain stable in future releases- Returns:
- the underlying Saxon Controller instance
 
 - 
newXMLFilterpublic org.xml.sax.XMLFilter newXMLFilter() Create a JAXP XMLFilter which allows this transformation to be added to a SAX pipeline- Returns:
- the transformation in the form of an XMLFilter
 
 - 
newTransformerHandlerpublic javax.xml.transform.sax.TransformerHandler newTransformerHandler() throws XPathExceptionGet a TransformerHandler that can be used to run the transformation by feeding in SAX events- Throws:
- XPathException
 
 - 
setParameterpublic void setParameter(java.lang.String name, java.lang.Object value)Add a parameter for the transformation.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. - Overrides:
- setParameterin class- IdentityTransformer
- Parameters:
- 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 coercion or to simply pass the object on for use in an extension.
- Throws:
- java.lang.NullPointerException- If value is null.
- java.lang.IllegalArgumentException- If the supplied value cannot be converted to the declared type of the corresponding stylesheet parameter
 
 - 
getParameterpublic java.lang.Object getParameter(java.lang.String name) Get a parameter that was explicitly set with setParameter.This method does not return a default parameter value, which cannot be determined until the node context is evaluated during the transformation process. - Overrides:
- getParameterin class- IdentityTransformer
- Parameters:
- name- of- Objectto get
- Returns:
- A parameter that has been set with setParameter, or null if no parameter with this name has been set.
 
 - 
getStylesheetOutputPropertiesprotected java.util.Properties getStylesheetOutputProperties() Get the output properties defined in the unnamed xsl:output declaration(s) within the stylesheet- Overrides:
- getStylesheetOutputPropertiesin class- IdentityTransformer
- Returns:
- the values of output properties set in the stylesheet
 
 - 
getUnderlyingXsltExecutablepublic XsltExecutable getUnderlyingXsltExecutable() Get the underlying s9api implementation class representing the compled stylesheet which this transformer is executing- Returns:
- the underlying s9api XsltExecutable
 
 
- 
 
-