Xslt遍历输出26个字母 <pre name="code" class="html"><?xml version="1.0" encoding="utf-8"?> <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe"> <xsl:output method="html" /> <xsl:variable name= "varStart" select= "65 "/> <!-- 定义初始值 --> <xsl:variable name= "varEnd" select= "91 "/> <!-- 定义结束值 --> <xsl:variable name= "varStep" select= "1 "/> <!-- 定义循环步长 --> <xsl:template name= "MyLoopFun"> <xsl:param name= "varStart"/> <xsl:if test= "$varStart < $varEnd "> <!-- 输出格式定义 --> <xsl:value-of select= "$varStart"/> <!-- 根据ASCII码值输出字母 --> <xsl:value-of select="concat('&#',$varStart)" disable-output-escaping="yes"/> <xsl:if test= "$varStart < ($varEnd - $varStep) "> <br/> </xsl:if> <xsl:call-template name= "MyLoopFun"> <xsl:with-param name= "varStart"> <xsl:value-of select= "$varStart + $varStep "/> </xsl:with-param> </xsl:call-template> </xsl:if> </xsl:template> <xsl:template match="/"> <xsl:call-template name= "MyLoopFun"> <xsl:with-param name= "varStart" select= "$varStart"> </xsl:with-param> </xsl:call-template> </xsl:template> </xsl:transform> <pre>