[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] increment value

Subject: RE: [xsl] increment value
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 22 Jan 2004 15:38:15 -0500

At 01:09 PM 1/22/2004, Anoop wrote:
Hi Ricardo,

>From what I understand, your problem seems to be same as mine: Please check
my posting today: Linear counting problem in nested loop.

I guess you have a nested loop within a loop (just like I have and you need
to set the ids as a linear counter value). I am in the same boat if I
understood you right. Good Luck. I hope someone out there (XSL Guru) may be
able to solve our issues.

Just about every problem for which programmers think they need counters can be done more easily in XSLT with other techniques. For example, here I think there may be a use for xsl:number. But I don't believe this problem has been fully specified yet for the list, although there've been several helpful replies.

Just because in some other system you'd use a variable as a counter, you shouldn't assume that's what's needed here. Those who are trying to help are not just being contrary: if the problem itself is one that has a better solution in XSLT than a counter (and judging from the experience of the list, that's true 99 times in 100), a responsible adviser is not going to jump in and tell you how to make the counter.

You don't want to go to an auto mechanic with a dead battery and say "my batteries dead: you have to replace it" and then have him sell you a new battery without finding out why the old one is dead. You might be back again to get a new battery before long -- whereas maybe the first one was fine, and it's something else in the car that needs fixing.

Likewise, in XSLT if you wanted you *could* implement a "counter" by passing a parameter in a recursive template call. But if that solution is complex and has ten times the footprint of a well-known, easier, better, solution, you want us to tell you the better solution.


-----Original Message-----
From: Ricardo Saraiva [mailto:rss@xxxxxxxxxxxxxx]
Sent: Thursday, January 22, 2004 12:47 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] increment value


        That was an example. The numbers were not to be added to the
        Imagine the example without the numbers.

How do I increment a variable to add to the string?

Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

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

Current Thread