Re: [xsl] Does the count() function require access to the whole subtree?

Subject: Re: [xsl] Does the count() function require access to the whole subtree?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 16 Jan 2014 16:20:51 +0000
> For example, your pipeline could collect all //x (streaming) and then
> reverse them (not streaming).
>
> In principle, you would need only the memory for holding //x (or
> rather, copies of //x or pointers to them), not the entire collection
> within which they are found.

Generally you can't keep a "pointer" to a streamed node, because it's
transient. But you can keep a copy.

So you should be able to do

reverse(/copy-of(/x))

The result of copy-of(//x) is grounded (it doesn't contain any streamed
nodes), and that makes it amenable to operations such as reverse().
>
>
> I also had a related question, back in September. It wasn't answered
> (rare for this list), either because it wasn't clear, or because XML
> Summer School was going on at the time. Or both.

Or possibly because the streaming design was completely up in the air at that
moment because we had just found a major bug. But I think we've still got some
issues with multi-phase streaming that need to be sorted out (that is, with
reading from a stream of nodes that is itself constructed by the stylesheet),
and such use cases need further work: we've got an agenda item to discuss
this.
>
> http://xsl-list.markmail.org/thread/pwuzpcvdoi7eam4h
>
Michael Kay
Saxonica

Current Thread