Re: [xslt] libxslt: xsl:include/import cache?



On Wed, 5 Dec 2001, Daniel Veillard wrote:

> On Wed, Dec 05, 2001 at 04:24:18PM +0000, Matt Sergeant wrote:
> > On Tue, 4 Dec 2001, Elizabeth Mattijsen wrote:
> >
> > > I've been looking for ways to reduce the memory usage of a web-server that
> > > will have a _lot_ of stylesheets, many of which will be referring to the
> > > same "subroutine" templates by using <xsl:include>.
> >
> > [snip]
> >
> > I've been thinking about this some, and I think it might be quite a useful
> > pattern for many people. So how about having a "document" callback, which
> > would be mutually exclusive with the current "open/read/close" callbacks?
> > It would just return a xmlDocPtr given a URI following a successful match.
>
>   So you grow up a pool of in-memory trees. How do you know when to free
> one of them ?

That's my problem, not yours.

> What's happen if you modify the tree you got as a result of
> the lookup ?

Again, my problem not yours. Or if you mean what happens if libxml/libxslt
modifies the tree, then you could simply xmlCopyDoc it on return, so that
it's a new doc, not the cached one you're processing.

> Reminder, libxslt will modify both the stylesheet document and
> the instances of the document transformed, and yes it's a speed optimization.

Yes, I know. And yes, a document callback would be a speed optimization.
Nothing wrong with giving people hooks on which to hang themselves.

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]