JAXP interface (transformation, XPath, schema processing)
It is now possible to run streaming XSLT 3.0 transformations using the JAXP API. The TransformerFactory
used must be an instance of com.saxonica.config.StreamingTransformerFactory. If the stylesheet is streamable
(more specifically if the initial mode is declared with <xsl:mode streamable="yes"/>
), then the Transformer.transform()
method, if given a SAXSource
or StreamSource
as its argument, will process the input document using streaming.
Under these circumstances the source document will not be available as the global context item: that is, any reference to the context item
"." within a global variable declaration is a dynamic error.
The newTransformerHandler()
method of the StreamingTransformerFactory
delivers an implementation of
TransformerHandler
that can be used to run a streamed transformation. After calling setResult()
to set the
destination of the transformation, the streamed input to the transformation can be supplied as a sequence of SAX ContentHandler
method calls, for example startElement()
and endElement()
.