1
私の試み:私は同じ結果を達成するために1つだけの機能を持つようにしたいの代わりに2つの機能(GetDisplayとGetDisplay_1)の必要性を持っていることのXSLT 1.0はthe_brown_foxを|ブラウン・フォックス|
<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>
(私たちは無傷でGetUpperを残すことができますもちろん)。
それは可能ですか?
PS:厳密にXSLT 1.0に感謝します。 (とEXSLT/etcありがとう)
nice。それを考えなかった= D – Troy