Re: [xsl] xsl:for-each efficiency

Subject: Re: [xsl] xsl:for-each efficiency
From: Tom Schutzer-Weissmann <xsl@xxxxxxxxxxxxxxxx>
Date: Tue, 16 Sep 2003 12:38:22 +0000
On Tuesday 16 Sep 2003 11:24, andrew.curry@xxxxxxxxxxxx wrote:
> Would there be a better way of doing:
> <xsl:for-each select="//element[@element-key = $id]">
> </xsl:for-each>
> for use over a very very large document?

Yes, use a key:
<xsl:key name="byId" match="element" use="@element-key"/>

<xsl:apply-templates select="key('byId',$id)"/>

Tom SW
"The facts are hideous, but we must face them" - Bertie Wooster

 XSL-List info and archive:

Current Thread