[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: recursion with xsl:apply-templates

Subject: RE: recursion with xsl:apply-templates
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Wed, 27 Aug 2003 15:39:32 +0100
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.