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.
  Sounds to me you have a design problem on the way you build your stylesheets
If you have instances of the same stylesheet all over the import tree,
then you're forcing by design a lot of redundancy.
  I'm not compelled to risk introducing very difficult to debug import
order problems because you designed your import tree to be arbitrarilly
complex. The space used by the stylesheet xmlDoc are shared at the XML
level I think, but the XSLT structure on top of it are not.


Daniel Veillard      | Red Hat Network  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

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