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



> > On Tue, Dec 04, 2001 at 12:31:18AM +0100, Elizabeth Mattijsen 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>?
> > 
> > Or are there other issues that would prevent this from working?

>   Won't work. I need to have the parent to implement correctly the import
> cascading semantic. And if the trees are shared this gets really complex.

In my program, I run many stylesheets with most of them including/importing
the some key stylesheets.  The retrieval of the stylesheets can be costly in
terms of time (using a custom-handled URI that retrieves them from various
zip/jar files, oracle databases, etc. mostly through the use of COM/DCOM)

I tried to cache the compiled stylesheets at various locations to no avail.
The only mechanism I could get to work was caching particular documents in
memory (unparsed) and using that cache in my i/o input callbacks.  Far from
ideal, but sped up the work significantly and didn't add much memory
footprint because in my case I am only caching 2 documents.  Best of all,
this is all done without any modifications to libxslt.

mark



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