Streamed processing of input documents

Streamed execution of xsl:call-template is possible provided the called template does not use the context item, and does not allow parameters that are bound to nodes; or if all the supplied arguments and the context item are grounded.

The has-children() function now has usage inspection rather than absorption, which means that a call on has-children() in streamed code is typically motionless; that is to say, it is possible to test whether an element has children without consuming the content. This is achieved using a tiny amount of look-ahead in the parsing pipeline.

The ability to initiate streaming using <xsl:apply-templates select="doc(x)" mode="streamable"/> has been dropped. Use xsl:stream instead. The option has been dropped because it is not in the XSLT 3.0 specification, and indeed was non-conformant because doc() is required to return stable results if called twice to process the same URI.

The ability to use explicit positions in streaming match patterns has been dropped: for example match="p[1]" is no longer motionless. This aligns Saxon with the W3C specification. Maintaining the data to support such patterns was a significant overhead, and the data was used only for this one purpose.

The system of UTypes used for streamability analysis in the spec is now implemented, alongside Saxon's traditional static type analysis. The UType system gives the potential for more precise static typing of constructs such as conditional expressions.

The use-accumulators attribute of xsl:stream is implemented. This means that an accumulator is not available with a particular input read using xsl:stream unless it was nominated on the xsl:stream instruction.

The use-accumulators attribute of xsl:global-context-item is implemented. This means that an accumulator is not available with the principal streamed input to the stylesheet unless it was nominated on the xsl:global-context-item instruction.

Streamed execution of union, intersect, and except expressions is implemented.

Streamed execution of xsl:where-populated, xsl:on-empty, and xsl:on-non-empty is implemented.