Michael, I may be having a flash of darkness, but I don't know how I would go about using the URI resolver that ships as a starting point for building one amenable to streaming.

In particular, I don't see how I can view the code for the URI Resolver that ships with the product. I can find a XQTSCollectionURIResolver.class  file in the saxon-resources9-4\saxon-resources9-4\drivers\java\classes\com\saxonica\testdriver folder, but I'm assuming that is a compiled file that is not human read-able.

Did you have something different in mind?

Note the only time I have used java is for a computer applications course in college 15 years ago, so I could easily be missing something obvious.

-David



On Tue, May 14, 2013 at 10:20 PM, Michael Kay <mike@saxonica.com> wrote:
A little embarrassing this...

It's true that the uri-collection() function was added in large measure for streaming applications. Saxon's CollectionURIResolver interface has been redesigned to make this possible, by allowing it to return a sequence of URIs rather than document nodes. However, the StandardCollectionURIResolver issued with the product and used by default does not yet take advantage of this capability. This is an oversight (probably because our main test driver uses its own CollectionURIResolver rather than the default one).

I'll log this as a bug. In the meantime you could consider writing a CollectionURIResolver based on the standard one, but modified to return URIs without dereferencing them.

Michael Kay
Saxonica


On 14 May 2013, at 10:45, David Rudel wrote:

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 9.3.0.5, run through oxYgen:

<xsl:stylesheet version="3.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:saxon="http://saxon.sf.net/"
    exclude-result-prefixes="xs saxon">

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


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.
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help



--

"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.