[Home] [By Thread] [By Date] [Recent Entries]
pankaj.c@xxxxxxxxxxxxxxxxxx wrote:
AHA!!!! Thanks Ken but I am using 1.0. Write a named template with a param that is increased on each recursive call: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="my_group">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:call-template name="make-group">
<xsl:with-param name="i" select="1"/>
<xsl:with-param name="l" select="3"/>
</xsl:call-template>
</xsl:copy>
</xsl:template> <xsl:template name="make-group">
<xsl:param name="i"/>
<xsl:param name="l"/>
<xsl:if test="$i <= $l">
<group name="type{$i}"/>
<xsl:call-template name="make-group">
<xsl:with-param name="i" select="$i + 1"/>
<xsl:with-param name="l" select="$l"/>
</xsl:call-template>
</xsl:if>
</xsl:template></xsl:stylesheet> -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|

Cart



