Bonjour à tous,
J'aimerais bien générer à l'intérieur du modèle le nom d'un paramètre
(d'une variable, ou d'un attribut), comme pour calculer le texte généré:
<fo:block>
<xsl:text>Zone </xsl:text>
<xsl:value-of select="@code_zone"/>
</fo:block>
Je m'explique: mon fichier XSL actuel s'écrit comme ceci:
<xsl:template name="ajout_lignes_supplement_cci">
<xsl:param name="nombre_ligne" select="'0'" />
<xsl:if test="$nombre_ligne!=0">
<xsl:call-template name="
ajout_lignes_supplement_cci">
<xsl:with-param name="nombre_ligne" select
="$nombre_ligne - 1" />
</xsl:call-template>
<fo:table-row height="4mm">
<fo:table-cell border-width="0.2pt"
text-align="center" border-style="solid" padding="1mm">
<fo:block>
<xsl:text>Zone C</xsl:text
>
<xsl:value-of select="
$nombre_ligne"/>
</fo:block>
</fo:table-cell>
<xsl:choose>
<xsl:when test="$nombre_ligne=1">
<fo:table-cell
border-width="0.2pt" text-align="center" border-style="solid" padding="1mm
">
<fo:block>
<
xsl:value-of select="//*/dataContrat/champFusion[@nom='montant_service_1
']/texte/text()"/>
</fo:block
>
</fo:table-cell>
</xsl:when>
<xsl:when test="$nombre_ligne=2">
<fo:table-cell
border-width="0.2pt" text-align="center" border-style="solid" padding="1mm
">
<fo:block>
<
xsl:value-of select="//*/dataContrat/champFusion[@nom='montant_service_2
2']/texte/text()"/>
</fo:block
>
</fo:table-cell>
</xsl:when>
.............................................................................................................
<xsl:when test="$nombre_ligne=9">
<fo:table-cell
border-width="0.2pt" text-align="center" border-style="solid" padding="1mm
">
<fo:block>
<
xsl:value-of select="//*/dataContrat/champFusion[@nom='montant_service_9
']/texte/text()"/>
</fo:block
>
</fo:table-cell>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</fo:table-row>
</xsl:if>
</xsl:template>
Est-ce qu'il y a uns solution pour éviter l'utilisation lourde de
<xsl:choose> en introduisant une variable pour montant_service_
{$nombre_ligne} ?
Je vous en remercie à l'avance!
Patrick
Patrick Jianxin KONG
TELINTRANS
Direction des Solutions Applicatives
E-Mail : jianxin.kong@telintrans.fr
Tel : (+33) 01 56 30 72 67
--------------------------------------------------------------------------------
Cet e-mail peut contenir des informations confidentielles ou couvertes par
le secret professionnel.
Si vous n'êtes pas le(s) destinataire(s) nommé(s), sa lecture ou
divulgation est rigoureusement interdite et nous vous remercions de le
détruire.
This message may contain information which is privileged or confidential.
If you are not the intended addressee(s) of this message, please destroy
it without reading, copying or disclosing its contents to any other
person.
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Received on Wed Dec 15 16:12:35 2004