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.
Cheers,
Wendell
-----Original Message-----
From: Ricardo Saraiva [mailto:rss(_at_)dee(_dot_)fct(_dot_)unl(_dot_)pt]
Sent: Thursday, January 22, 2004 12:47 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] increment value
Hi,
That was an example. The numbers were not to be added to the
string.
Imagine the example without the numbers.
How do I increment a variable to add to the string?
======================================================================
Wendell Piez
mailto:wapiez(_at_)mulberrytech(_dot_)com
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