Re: [xslt] xsltEvalGlobalVariables caching



Does libxslt have something similar to java/jaxp TransformerFactory and
Transformer. You generally want to compile a Templates off of the
TransformerFactory and then derive a unique Transformer from that
Templates object. Instead, if you reuse the Transformer you can use the
same params/imports/includes and XML from the document function.

best,
-Rob


On Wed, 2008-03-19 at 14:11 -0400, Daniel Veillard wrote:
> On Wed, Mar 19, 2008 at 04:58:53PM +0100, Piotr Gaczkowski wrote:
> > Hello!
> > 
> > I am new to this list and would like to ask a question about possible
> > reusing of parsed stylesheet.
> > 
> > In a project that I'm working on there is a situation where lots of
> > small elements (most of them <1kB) are parsed in large quantities by
> > quite complex stylesheets.
> > 
> > There is a fixed number of stylesheets and the main problem (according
> > to profiler) is with xsltEvalGlobalVariables. It consumes about 80% of
> > the transforming time, because variables are initialized using
> > internal templates producing bytecode, etc.
> > 
> > Is there a way to do the following:
> > 1. Parse a stylesheet
> > 2. Resolve all the variables
> > 3. Apply the stylesheet to a number of docs
> > 4. Free the resources?
> > 
> > Currently, as I see it, the globals are resolved in the same phase as
> > applying the stylesheet which is improper for me
> 
>   The problem is that in general global variables can be dependant
> upon parameters passed to the stylesheet, so they can't be computed
> when the stylesheet is compiled.
>   If you find a way to detect that a global variable is not dependant
> on any parameters, than maybe the evaluation could be done at compile
> time. That's certainly feasible, but honestly I don't really have the
> time to develp such a patch.
> 
> Daniel
> 



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