Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - for-each A to Z [Thread Next] RE: for-each A to ZTo: NULL Date: 4/4/2006 2:39:00 AM
Instead of a for-each loop, you can write a recursive named template to
achieve this..
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" />
<xsl:variable name="alphabets" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:template match="/">
<xsl:call-template name="IterateAlphabets">
<xsl:with-param name="alphabets" select="$alphabets" />
</xsl:call-template>
</xsl:template>
<xsl:template name="IterateAlphabets">
<xsl:param name="alphabets" />
<xsl:if test="string-length($alphabets) != 0">
<xsl:value-of select="substring($alphabets,1,1)" /><xsl:text>
</xsl:text>
<xsl:call-template name="IterateAlphabets">
<xsl:with-param name="alphabets" select="substring($alphabets,2)" />
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Regards,
Mukul
"Mystique" wrote:
> how can i create for-each loop to through all the letters of the alphabet
> from A to Z?
>
> regards,
> Mystique
>
>
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
