1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <xsl:call-template name="collapse">
<xsl:with-param name="phrase" select="normalize-space('voici ma phrase')"/>
</xsl:call-template>
[...]
<xsl:template name="collapse">
<xsl:param name="phrase"/>
<xsl:variable name="restant" select="substring-after($phrase, ' ')"/>
<xsl:choose>
<xsl:when test="$restant != ''">
<xsl:call-template name="collapse">
<xsl:with-param name="phrase" select="concat(substring-before($phrase, ' '), translate(substring($restant, 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), substring($restant, 2))"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(translate(substring($phrase, 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), substring($phrase, 2))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template> |
Partager