xsl-list
[Top] [All Lists]

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

2012-08-06 12:45:43
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>