I have found the reason for one of my streaming problems.

I am using uri-collection to read in a bunch of URIs. The xslt3 documentation indicates that one of the reasons uri-collection may be favored over collection() is that the former allows streaming.

However, running the following with the -t command indicates that uri-collection() is causing entire trees to be written into memory in Saxon, run through oxYgen:

<xsl:stylesheet version="3.0"
    exclude-result-prefixes="xs saxon">

    <xsl:template match="/">
<xsl:variable name="path" select="replace(base-uri(),'(.*/)[^/]+?.xml','$1')"/>
    <xsl:for-each select="(uri-collection(concat($path,'?select=*.xml;recurse=yes;on-error=ignore')))">
        <xsl:value-of select="."/>

I also tried using xsl:iterate and saxon:iterate [based on the information in the documentation for Saxon 9.3], and trees were being built in all cases.

I don't see how to use saxon:stream() in this case because the entire tree is being built by uri-collection() before the document ever sees saxon:stream().


"A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.