Configuration options for streaming
Saxon attempts streamed evaluation only if it is explicitly requested. Streaming may be requested in a number of ways:
-
By use of XSLT 3.0 language constructs that request streaming, for example the xsl:stream instruction or by specifying
streamable="yes"
on xsl:mode or xsl:accumulator. -
By use of a Saxon extension that requests streaming, for example saxon:stream.
-
By setting the option
-stream:on
in the XQuery command line, or the equivalent API option (for example, in s9api,XQueryCompiler.setStreaming(true)
).
Where streaming is requested within a stylesheet using XSLT 3.0 language constructs, two configuration options are available to control how Saxon behaves.
The configuration option FeatureKeys.STREAMABILITY may be set to one of the values "off", "standard", or "extended". The default for Saxon-EE (when a suitable license is available) is "standard", and in all other cases is "off". This option affects how the streamability of constructs in the stylesheet is assessed in cases where streaming is requested:
-
The option "off" causes all constructs to be deemed non-streamable. This allows streaming to be suppressed even in cases where it would be feasible.
-
The option "standard" causes streamability to be assessed using the rules for "guaranteed streamability" in the W3C XSLT 3.0 specification (or as close to these rules as Saxon can manage).
-
The option "extended" enables Saxon streamability extensions, allowing some constructs to be streamed even when they are not guaranteed-streamable according to the W3C rules.
The second configuration option FeatureKeys.STREAMING_FALLBACK determines what Saxon does when it encounters a construct that (under the rules above) is deemed non-streamable. This is a boolean option. If it is set to true, Saxon attempts a non-streaming implementation of the relevant constructs. If sufficient memory is available for a non-streaming evaluation, this should always give the same result as a streamed evaluation. When the option is set to false (the default), the presence of a construct that is deemed non-streamable causes a static (compile-time) error.
When running from the command line these options can be set for example as
--streamability:off
or --streamingFallback:on
.