Re: [xsl] Theory question about keys (no code)

Subject: Re: [xsl] Theory question about keys (no code)
From: Liam R E Quin <liam@xxxxxx>
Date: Mon, 06 Aug 2012 13:44:36 -0400
On Mon, 2012-08-06 at 17:16 +0000, FAIR, ED wrote:

> My question is:  when is the associative array built?  Is it built
> entirely in the beginning, as the source document is first read into
> memory?  Or is it built incrementally, as each template is matched
> during transformation?
> 
> FWIW, I am using xslt 1.0, xsltproc in Solaris 10:

It depends on the implementation: most likely before matching any
templates, but in any case before it's first used. However, an
implementation is free not to pre-compute key values but to search the
whole document each time you try to fetch a nodelist by key value.

If performance is an issue you might also want to compare with running a
recent version of Saxon (which I think builds the keys as it reads the
XML input, along with a table for optimizing "//").

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

Current Thread