Subject: Re: [xsl] recursion with xsl:apply-templates From: Volker Witzel <volker.witzel@xxxxxxxxxxxx> Date: Wed, 27 Aug 2003 17:38:34 +0200 |
<xsl:template match="*[@index]"> <xsl:copy> <xsl:copy-of select="@*[not(name()='index')]"/> <xsl:variable name="p" select="count(preceding::*[@index])+1"/>
This is fine if it does what you need, but you should be aware that using the preceding::* axis in this way leads to O(n^2) performance.
It's much better practise to store the data you need in a nodeset, and then query that. This means you will do one pass for the nodeset, and one pass for the data regardless of the number of elements in your source.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
-- Mit freundlichen Grüßen / With kind regards Volker Witzel ____________________________________________ IBM Business Consulting Services Karl-Arnold-Platz 1a, D-40474 Düsseldorf fon (0211) 476-1924 (intern *129-1924) mobil 0172-73 66 586 mail vwitzel@xxxxxxxxxx
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] recursion with xsl:apply-, Andrew Welch | Thread | [xsl] URL rewriting with session id, Shane Porter |
Re: AW: [xsl] recursion with xsl:ap, David Carlisle | Date | Re: [xsl] Entities in Presentation , David Carlisle |
Month |