Subject: Re: [xsl] Generate N elements and attribute values From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 16 Jul 2004 16:14:26 -0400 |
<xsl:template name="outer"> <xsl:param name="count" select="0"/> .... <xsl:call-template name="inner"> <xsl:with-param name="outer-count" select="$count"/> </xsl:call-template> <xsl:if test="$count < $max-count)"> <xsl:call-template name="outer"> <xsl:with-param name="count" select="$count + 1"/> </xsl:call-template> </xsl:if> </xsl:template>
Cheers, Wendell
I have already posted a question on how to generate dynamic attribute values within a recursive template, but I have to admit that I got a bit confused when reading my own posting, so I retry with a simplified version of my problem.
A recursive template is generating N=4 <tr> and another inline recursive template is generating n=3 <td> and so far I have no problems. But when it comes to the attribute values of <td name="?"/> I really do not know what to do since the @name of <td> is generated on the fly and after all <tr> are generated. As shown in the result tree below the @name of <td> always follows the @no of <tr>.
So my simple question is how to generate @name values on the fly?
This is the result tree I need:
<tr no="0"> <td name="0"/> <td name="0"/> <td name="0"/> </tr> <tr no="1"> <td name="1"/> <td name="1"/> <td name="1"/> </tr> <tr no="2"> <td name="2"/> <td name="2"/> <td name="2"/> </tr> <tr no="3"> <td name="3"/> <td name="3"/> <td name="3"/> </tr>
Thanks, Kenny Bogoe
====================================================================== 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 ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Generate N elements and attri, Kenny Bogoe (BogoeMD | Thread | Re: [xsl] Generate N elements and a, Kenny Bogoe (BogoeMD |
RE: [xsl] Walking a complex object , Michael Kay | Date | [xsl] Retaining value of a Global v, Vivek Shinde |
Month |