My attempt:
<xsl:template name="GetDisplay">
<xsl:param name="input"/>
<xsl:text>|</xsl:text>
<xsl:call-template name="GetDisplay_1">
<xsl:with-param name="input" select="$input"/>
</xsl:call-template>
<xsl:text> |</xsl:text>
</xsl:template>
<xsl:template name="GetDisplay_1">
<xsl:param name="input"/>
<xsl:text> </xsl:text>
<xsl:call-template name="GetUpper">
<xsl:with-param name="input" select="substring($input,1,1)"/>
</xsl:call-template>
<xsl:variable name="head" select="substring-before($input,'_')"/>
<xsl:choose>
<xsl:when test="$head=''">
<xsl:value-of select="substring($input,2)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($head,2)"/>
<xsl:call-template name="GetDisplay_1">
<xsl:with-param name="input" select="substring-after($input,'_')"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="GetUpper">
<xsl:param name="input"/>
<xsl:value-of select="translate($input,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
</xsl:template>
Instead of having the need of 2 functions (GetDisplay and GetDisplay_1) i want to have only 1 function to accomplish the same result (we may leave the GetUpper intact of course).
Is it even possible?
PS: Strictly XSLT 1.0 thanks. (and no EXSLT / etc thanks)
Why not adding a parameter, to be used only on the first call?