Re: [xslt] xsltEvalGlobalVariables caching

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.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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