Re: [xslt] efficiency
- From: Daniel Veillard <veillard redhat com>
- To: xslt gnome org
- Subject: Re: [xslt] efficiency
- Date: Thu, 23 May 2002 03:09:21 -0400
On Thu, May 23, 2002 at 02:54:43AM -0400, Michael Rothwell wrote:
> Thanks. I'll check that out.
>
> Well, I've figured out that doing this:
>
> select="//page/@id"
>
> ...in a loop is bad.
// means the whole tree is scanned to find the associated nodes !!!
> Since I use that value in a lot of places, I did this at the top of the
> stylesheet file:
>
> <xsl:variable name="pageid" select="//page/@id"/>
>
> and refer to $pageid rather than //page/@id
>
> ... one order of magnitude faster.
should also become linear w.r.t. the input tree size.
Daniel
--
Daniel Veillard | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]