[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] How to write a stream-oriented XSLT filter?

Subject: Re: [xsl] How to write a stream-oriented XSLT filter?
From: John English <john.foreign@xxxxxxxxx>
Date: Wed, 27 Mar 2013 12:04:40 +0200

On 26/03/2013 21:20, Michael Kay wrote:
The only way to get the data from one to the other without putting it all in
memory is to run them in separate threads with a shared buffer.

That's the only way I could think of doing it as well, but I don't fancy running two threads for every request. (And it also explains why I haven't found any streaming examples of filters out there!)

However... How large is your output? It's quite possible to handle 100Mb or so
before you have to resort to streaming. And surely 100Mb is far more than you
want to send to a browser. Perhaps you're dealing with much smaller data sizes
and you just need to change your system configuration so it doesn't run out of

I discovered a pathological case the hard way. I'm displaying tables out of a DB with options to filter the selected rows and also select the number of rows per page (10, 20, 50, 100, ALL). The table remembers the last rows-per-page selection. If I select say 200 rows and I want to see all of them, that's fine, but if I go back to the same table (currently ~200K rows and growing), the filter isn't remembered and it tries to display all of the rows. One of the fields is a clob, so it can be a lot of data -- I don't know exactly how much because it dies before it can tell me!

It sounds like it would be simpler for me to just cap the number of rows per page to 10000 or some such, and experiment to find out when it blows up to choose a high but safe limit. Except for the one table that showed up the problem, 10000 would generally be equivalent to "all"...

Thanks for the advice,
John English

Current Thread