|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Number of times apply-templates gets 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
|
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
|

Cart








