Re: [xsl] keys vs. parameters

Subject: Re: [xsl] keys vs. parameters
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Fri, 7 Jun 2002 16:38:43 -0400
[Hunsberger, Peter]

> > If you use xsl:key then (separate) key tables are made for that match in
> > _every_ document processed (conceptually, the system probably has
> > optimisations so it doesn't produce tables that are never used).
> >
> > when you use key('foo','bar') it looks up bar in the foo table
> > associated with the current document. So you just need to make sure you
> > are
> > in the document that you want, so
>
> Umm, all fine and good, but how do you generate the key table in the first
> place?  I don't want the keys on the main document, I want them on the
> document processed by document() (or in some cases on the data produced by
> an extension)...
>

The processor generally creates the key index when it finds it is needed.
If you never use the key on an element in the main document, the processor
will probably never create an index for the main document.  When you use the
key in the context of one of the document() node sets, the index for that
nodeset will be created.  At least, that's how the good processors do it,
AFAIK.

Mike Kay will probably have something more authoritative to say about it.

Cheers,

Tom P


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread