Hi, > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Buchcik, Kasimier
> Hi, > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > On Behalf Of Mark Vakoc > > > > 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: [...] > I think we could easily change this further to cleanup tree fragments, > which were created in/underneath an instruction, directly after an > instruction exits - if this is what you mean. Taking xsl:for-each [...] While implementing the cleanup of temporary tree fragments directly when an instruction exits, I noticed that we'll get problems if trying to do the same for extension elements. With the current implementation of EXSLT's functions, this won't work: <func:function name="foo:foo"> <func:result>result</func:result> </func:function> When <func:result> exits, we still need to preserve the tree fragment, until <func:function> exits. With xsltRegisterTmpRVT(), there's no way to define the scope of the tree fragment; e.g. one cannot bind it to the <func:function> (e.g. with a unique stamp for a specific instruction/extension element). Since this cannot be undone (xsltRegisterTmpRVT() is probably also used in other extension elements), I'll leave out extension elements from this optimization. Maybe we can optimize this also for EXSLT's functions; we'll need an other registration function for this. Regards, Kasimier _______________________________________________ xslt mailing list, project page http://xmlsoft.org/XSLT/ [email protected] http://mail.gnome.org/mailman/listinfo/xslt
