-- 作者:pope3618
-- 发布时间:3/22/2007 1:31:00 PM
-- 分割字符串 将每个子串赋给不同的变量的问题
0,籍贯,dataType_LimitB,min_3,max_10 目标字符串如上,以 ,分割 如何能将不同的子串赋给不同的变量 <xsl:if test="substring-before($ekey,',')='0'"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:call-template name="splitStr"> <xsl:with-param name="str" select="$ekey"/> </xsl:call-template> </xsl:copy> </xsl:if> <xsl:template name="splitStr"> <xsl:param name="str"/> <xsl:choose> <xsl:when test="contains($str,',')"> <xsl:variable name="pp" > <xsl:value-of select="substring-before($str,',')"/> </xsl:variable> <xsl:if test="contains($pp,'_')"> <xsl:variable name="DD" > <xsl:value-of select="substring-before($pp,'_')"/> </xsl:variable> <xsl:variable name="QQ" > <xsl:value-of select="substring-after($pp,'_')"/> </xsl:variable> </xsl:if> <xsl:variable name="input"> <xsl:for-each select="$ppacd"> <xsl:value-of select="key('ename',$pp)"/> </xsl:for-each> </xsl:variable> <xsl:if test="$input !=''"> <input type="text"> <xsl:attribute name="id"> <xsl:value-of select="$input"/> </xsl:attribute> <xsl:attribute name="name"> <xsl:value-of select="$input"/> </xsl:attribute> </input> <xsl:if test="contains($pp,'_')"> <xsl:variable name="pp" > <xsl:value-of select="substring-before($str,',')"/> </xsl:variable> </xsl:if> </xsl:if> </xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose> <xsl:if test="contains($str,',')"> <xsl:call-template name="splitStr"> <xsl:with-param name="str" select="substring-after($str,',')"/> </xsl:call-template> </xsl:if> </xsl:template> 现在只能做到取一个子串赋给变量QQ 但我想把不同的子串赋给不同的变量如何做到 因为要同时用到
|