Re: [xml-bindings]Memoization



On Thu, Aug 22, 2002 at 10:57:23AM -0400, Daniel Veillard wrote:
> On Thu, Aug 22, 2002 at 03:51:28PM +0100, Gary Benson wrote:
> > On Thu, Aug 22, 2002 at 08:13:21AM -0400, Daniel Veillard wrote:
> > 
> > >   Hum, there is no such mechanism, the only way would be to add an
> > > interface to libxslt to plug-in a document cache. Note that for a single
> > > transformation all the document() result are cached (this is actually
> > > required by the XSLT spec), but there is no mechanism for a more global
> > > cache. Could make sense, could be very small change if one doesn't
> > > try to implement a default cache in libxslt itself.
> > 
> > I'm not trying to cache the results of transformations: each one only
> 
>   it's not what I suggested :-)
> I suggested to cache the documents loaded by document() at runtime
> application wide.

Ah.  The problem is that not all the loadings occur from within XSLT: 

> > the file containing all the diary entries

 - loaded in Bython with libxml2.parseFile()

> > the XSLT file that converts one day's worth of entries into i.o markup

 - loaded in Python with libxml2.parseFile() and libxslt.parseStylesheetDoc()

> > and the XSLT file that converts i.o markup to HTML.

 - loaded in Python with libxslt.loadStylesheetPI()

> > The second XSLT file includes three more files

 - loaded in XSLT with <xsl:import>

> > one of which parses the file full of diary entries again to create
> > the calendar. 

 - loaded in XSLT with document()

That's why I wanted to cache at libxml level: there are so many
different ways that documents get loaded that libxml is the lowest
common denominator for them all.

> > Any ideas on where to start?
> 
>   Do it as a single XSLT transform using chunking to split out the various
> HTML files, within a single transormation all the document used as input 
> are cached in their preparsed form, i.e. all XML documents used will be
> parsed only once.

Yeah, that's what I was referring to when I mentioned rearranging it
earlier.  Unfortunatly, one of the interfaces to the app is a
mini-webserver so single-input, multiple-output doesn't work here :(

Cheers,
Gary

[ gary inauspicious org ][ GnuPG 85A8F78B ][ http://inauspicious.org/ ]



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