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

RE: Number of times apply-templates gets executed.

Subject: RE: Number of times apply-templates gets executed.
From: cknell@xxxxxxxxxx
Date: Tue, 07 Jan 2003 11:29:05 -0500
why was charles 1 executed
1. That is correct. With this proviso: A variable can be re-defined in a different context. For example, a variable template inside an <xsl:for-each> element will be re-defined with each iteration.

2. This is more difficult to answer. You could, for instance create a variable which hold the value of a count() or last() function whose argument is an XPath expression which is the same as the value of the "select" attribute of your template. If you call the same template in a variety of contexts, you would have to create a variable for each context with differing XPath expressions for each context and then add them.

3. Counters (if you mean something that increments during the transformation) are not possible. See answer to question 1.

Booleans are the result of an equality comparison and the results of the comparison can easily be assigned to a variable.
-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     "Patel, Viral" <viral.patel@xxxxxxxxxxxxxxxxxxxx>
Sent:     Tue, 7 Jan 2003 09:54:52 -0600
To:       "'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'" <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Subject:   Number of times apply-templates gets executed.

Hi,

I am new to XSL and I have several questions - some of them might be really
easy ones but I just want to confirm.
1. I believe its not possible to change the value of <xsl:variable> once its
set - correct?

2. Is there a way to figure out how many times a template was applied when
using <xsl:apply-templates>?

3. Is there an easy to implement a counter or a boolean in xsl? If yes then
how? Implementing either one would be fine.

Thanks
V. Patel.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 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.