Bonjour,
J'ai besoin de faire une addition de la manière suivante :
En C cela donnerait :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7int Somme = 0; while (!Condition()){ Val = Res(); Somme = Somme + Val; } affiche(Somme);Mon souci est que j'ai l'impression que je ne peux pas récupérer les valeurs de mes variables en dehors de la boucle (portée limitée au for-each). J'ai également essayé avec des variables temporaires.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <xsl:variable name='CreditAff'>0</xsl:variable> <xsl:variable name='DebitAff'>0</xsl:variable> --> <!-- affichage du debit et du credit --> <xsl:for-each select='/invoice/SUB_ACCOUNTS'> <xsl:sort select='SERVICES[@elem=0]/LOGIN'/> <xsl:if test='...'> <xsl:variable name='DebitCredit'> <xsl:call-template name='DebitCreditMutualisation'> <xsl:with-param name='Item' select='SUB_ITEMS'/> </xsl:call-template> </xsl:variable> <xsl:variable name='Credit'><xsl:value-of select='substring-before(substring-after($DebitCredit,"|CREDIT:"),"|FIN")'/></xsl:variable> <xsl:variable name='Debit'><xsl:value-of select='substring-before(substring-after($DebitCredit,"|DEBIT:"),"|CREDIT:")'/></xsl:variable> <xsl:variable name='CreditAff' select='$Credit + $CreditAff'/> <xsl:variable name='DebitAff'><xsl:value-of select='$Debit + $DebitAff'/></xsl:variable> </xsl:if> </xsl:for-each> DEBIT:<xsl:value-of select='$DebitAff'/> CREDIT:<xsl:value-of select='$CreditAff'/>
Quelqu'un aurait une solution ?





Répondre avec citation


Partager