Subject: Re: [xsl] Does the count() function require access to the whole subtree? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxx> Date: Thu, 16 Jan 2014 14:31:30 -0500 |
Hi, Thanks Mike for confirming my intuition. And thanks to Dimitre for taking my second question to its logical limit (I think) and posing it there. :-) Cheers, Wendell Wendell Piez | http://www.wendellpiez.com XML | XSLT | electronic publishing Eat Your Vegetables _____oo_________o_o___ooooo____ooooooo_^ On Thu, Jan 16, 2014 at 11:20 AM, Michael Kay <mike@xxxxxxxxxxxx> wrote: >> >> 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Does the count() function, Dimitre Novatchev | Thread | Re: [xsl] Does the count() function, Dimitre Novatchev |
Re: [xsl] Does the count() function, Dimitre Novatchev | Date | Re: [xsl] Does the count() function, Dimitre Novatchev |
Month |