Hum, part of my e-mail is missing, see below:


> > Registered RTFs are then freed on every exit of xsltApplyOneTemplate().
> > This means that the lifetime of RTFs is managed by Libxslt itself. This
> > might be also the reason why there's no "free" function for RTFs yet.

> A note about this:  the lifetime of created RVTs used to give me tremendous 
> resource 
> problems in the past, though admittedly probably a rare situation.  I had an 
> extension 
> function that would return > database results as RVTs.  The fact that they 
> were only 
> freed once leaving a template forced me to dramatically suboptimally re-write 
> the 
> XSLT to reduce the overhead generated.  Where I wanted to > do:

> <xsl:template match="something">
> <xsl:for-each select="my:sql-many-results-func()/results/row">
 >  <xsl:for-each select="my:some-other-sql-query('some query using the 
 > previous row'">
     
> </xsl:template>

What I had to do was:

<xsl:template match="something">
<xsl:apply-templates select="my:sql-many-results-func()/results/row"/>
</xsl:template>

<xsl:template match="row">
<xsl:apply templates select="my:some-other-sql-query('some query using the 
previous row')" mode="mode2"/>
</xsl:template>

<xsl:template match="row" mode="row2">

</xsl:template>

> Not really the best example, but  had a few downsides:
>  1.  required template matching to work on RVTs (actually RVTs converted to 
> node-sets like exsl:node-set() would do), which I think is against any spec 
> but Daniel always made it work
>  2.  sometimes created some very ugly/verbose stylesheets
>  3.  still sometimes tough to reduce the memory overhead for large RVTs 
> returned.

> I remember trying for a long time to improve the granularity such that RVTs 
> created 
> within <xsl:for-each> and other instructions , underneath elements within a 
> template, or generally anywhere a variable would no longer be in scope would 
> be 
> freed when you leave that boundary.  I could never get it to work properly 
> but I
> 'm sure it's possible.



_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
[email protected]
http://mail.gnome.org/mailman/listinfo/xslt

Reply via email to