[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: recursion with xsl:apply-templates
> <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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|