xsl-list
[Top] [All Lists]

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

2014-01-16 13:35:50
Wendell,

Thank you for asking this question, which prompted me to ask for
streaming output.

I have been discussing this offline in the past, and this wasn't
something new, but your last message seemed the most appropriate and
natural base for raising the "streamed output" topic.

On Thu, Jan 16, 2014 at 11:31 AM, Wendell Piez 
<wapiez(_at_)wendellpiez(_dot_)com> wrote:
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(_at_)saxonica(_dot_)com> 
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--