1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| <xsl:template match="montest">
<xsl:variable name="sig" select="'En tant que'" />
<xsl:copy>
<xsl:call-template name="breakup-and-process">
<xsl:with-param name="binit" select="1" />
<xsl:with-param name="s" select="normalize-space(.)" />
<xsl:with-param name="sep" select="$sig" />
</xsl:call-template>
</xsl:copy>
</xsl:template>
<xsl:template name="breakup-and-process">
<xsl:param name="binit" />
<xsl:param name="s" />
<xsl:param name="sep" />
<xsl:choose>
<xsl:when test="contains($s,$sep)">
<xsl:if test="$binit!=1">
<xsl:call-template name="proc">
<xsl:with-param name="v" select="normalize-space(substring-before($s,$sep))" />
<xsl:with-param name="pref" select="$sep" />
</xsl:call-template>
</xsl:if>
<xsl:call-template name="breakup-and-process">
<xsl:with-param name="binit" select="0" />
<xsl:with-param name="s" select="substring-after($s, $sep)" />
<xsl:with-param name="sep" select="$sep" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$binit!=1">
<xsl:call-template name="proc">
<xsl:with-param name="v" select="normalize-space($s)" />
<xsl:with-param name="pref" select="$sep" />
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="proc">
<xsl:param name="v" />
<xsl:param name="pref" />
<xsl:if test="$v!=''">
<tr>
<td><xsl:value-of select="$pref" /></td>
<td><xsl:value-of select="$v" /></td>
</tr>
</xsl:if>
</xsl:template> |
Partager