[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [XSLT Streaming] How do I know that my input docum

Subject: Re: [XSLT Streaming] How do I know that my input document was processed in a streaming fashion?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Tue, 27 Aug 2013 22:04:16 +0100
Re:  [XSLT Streaming] How do I know that my input docum
On 27 Aug 2013, at 20:02, Costello, Roger L. wrote:

> Hi Folks,
>
> I want to count the number of Book elements in BookCatalogue.
>
> I want to do it using XSLT Streaming.
>
> Below are two solutions. One uses <xsl:stream>, the other uses <xsl:mode>.
>
> Two Questions Please:
>
> 1. Are my two solutions equivalent?

Yes. And in fact, I suspect that xsl:stream is redundant, in that there's
nothing it can do that you can't do with

<xsl:apply-templates select=doc() mode=streaming>

(We had ambitions for xsl:stream to add more attributes controlling the way in
which the document was read, but these are largely unrealised.)
>
> 2. I ran my solutions and they produced the correct result. They ran fast,
but the input document is small (only 3 Books). How do I know that the input
document was actually processed in a streaming fashion?

In Saxon, largely by (a) the absence of a message telling you that it's
building a tree, and (b) the presence of messages in the "explain" output, and
(c) the fact that you don't run out of memory when the document gets big.
There's no standard way of doing it programmatically. It might be nice if
there was.

Note that running fast is NOT a benefit you should expect from streaming. With
Saxon, streaming is slower than in-memory processing. Perhaps the difference
will get smaller in time, but at the moment, it's a space/time trade-off - you
give the processor less memory, so it takes more time. The benefit of
streaming is that you can process very large documents with very small amounts
of memory, full stop.
>
>

Michael Kay
Saxonica

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.