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



At 01:21 AM 12/4/01 +0000, Justin Fletcher wrote:
>In message <4.2.0.58.20011204002129.02864100@pop.dijkmat.nl>
>           Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
> > Would it be _too_ simplistic to create a memory cache, keyed to URI, that
> > would save the "include" pointer and return that if the stylesheet at that
> > URI was already loaded before?  And this save a _lot_ of memory when
> > multiple stylesheets use the same stylesheet through <xsl:include>?
>Whilst I'm not clear on the internals of xslt's implementation, it might be
>possible for the users callback function of the loader to do this.

Ah, ok.  I guess my question is: if such a loader in the callback is 
possible, would the general idea work or not (with regards to the innards 
of libxslt)?


>... However,
>there is little reason why the stylesheet requested could not be from a
>remote resource (particularly if it's not found in the catalog). If it is
>a remote resource [1], then there's no necessity for it to remain constant -
>conside a URI such as
>
>   http://www.movspclr.co.uk/cgi-bin/give-me-a-random-stylesheet.cgi
>
>Consequently, it's probably not an issue for the libxslt implementation, but
>for user code.
>[1] local resources might also generate different data; take for example
>     a local file that is coming from a unix pipe.

Good point.  But assuming I know for sure a certain that the data is the 
same.  Would it be possible to do?  Or am I working with a faulty design, 
wanting to "share" xsl:included stylesheets, from the start?


Elizabeth Mattijsen




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