Hello,
I'm having trouble understanding why the following recursive function is generating an error:
Code:
<xsl:template name="removeEndingChars">
<xsl:param name="currStr" select="tst"/>
<xsl:variable name="strLen" select="string-length($currStr)"/>
<xsl:comment>Keep stripping end character until we reach a space, then display it</xsl:comment>
<xsl:if test="substring($currStr, $strLen - 1, $strLen) = ' '">
<xsl:value-of select="normalize-space($currStr)"/>...
</xsl:if>
<xsl:if test="substring($currStr, $strLen - 1, $strLen) != ' '">
<xsl:variable name="splitStr" select="substring($currStr, 1, $strLen - 1)"/>
<xsl:call-template name="removeEndingChars">
<xsl:with-param name="currStr" select="$splitStr"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
The error is generated when I include the recursive call-template in the second if statement. Any help would be greatly appreciated.