xsl-list
[Top] [All Lists]

Re: xsl:for-each efficiency

2003-09-16 05:38:22
On Tuesday 16 Sep 2003 11:24, andrew(_dot_)curry(_at_)pa(_dot_)press(_dot_)net 
wrote:
Would there be a better way of doing:

<xsl:for-each select="//element[(_at_)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:  http://www.mulberrytech.com/xsl/xsl-list