cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwin Glaser <ed...@pannenleiter.de>
Subject Re: cocoon performance
Date Sat, 08 Apr 2000 17:20:17 GMT
Hello,

Stefano Mazzocchi wrote:

>> Will it be possible, with Cocoon 2, to begin to send data to the client before
>> "processing" (XSP, XSLT, XSL ...) is finished ? (with SAX, if I've understood)

>in theory, yes.

> in practice, you need an incremental XSLT and none are available, but
> this is not something I can control :(

Hmmm, it can be done with an ordinary XSLT processor. But porting will
be hard until we get a standard for extention elements.

If you put a producer into an extention element or an extention function,
that returns a node-set, you can do it in one pass. If this node-set
uses a lazy-evaluation strategy, you will be able to render the output,
while the producer is still working. Arkin suggested to implement such 
a thing on top of the castor package.

Your stylesheet may include templates like this one:


<xsl:include "render-content.xsl"/>

<xsl:template match="content[@id]">

  <xsl:variable name="content">
    <cocoon:generator type="sql" connection="foo_connection">
      select * from foo_table where id = <xsl:value-of select="@id"/>
    </cocoon:generator>
  </xsl:variable>

 <xsl:apply-templates select="$content" mode="render-content"/>

<xsl:template>


At first, this template looks strange. But as soon as you get used to it,
the combination of extention elements with the apply-templates builtin
becomes a very powerful design pattern. I have no idea how to merge this
kind of producers with the sitemap approach. But I think as soon as we
find a solution, we will get the next generation of XML tools but one.

-- 
Edwin Glaser -- edwin@pannenleiter.de


Mime
View raw message