Article View: fr.comp.text.xml
Article #9756Re: Sommer un calcul
From: Sydney
Date: Thu, 15 Feb 2001 09:39
Date: Thu, 15 Feb 2001 09:39
45 lines
2545 bytes
2545 bytes
Salut Si XSLT 1.1 permet d'ecrire ce que vous avez sugg�r�, c'est int�ressant de la savoir, ca peut simplifier quelques problemes. Pour le mien, j'ai utiliser une solution recursive conseill� par Tom. > Est-ce que je me trompe en disant que XSLT 1.1 permettra d'ecrire : > > <xsl:variable name="sxy"> > <xsl:for-each select="note"> > <np><xsl:value-of select="@obtenu*@coeff"/></np> > </xsl:for-each> > </xsl:variable> > > <xsl:variable name="moyenne" select="sum($sxy/np)/count($sxy/np)"/> D'ailleurs j'ai une petite question concernant les xsl:variable dans des "fonctions" recursives. Par ex: <xsl:template name="test"> <xsl:param name="i"/> <xsl:choose> <xsl:when test="$i = 0"> <xsl:text>Fini</xsl:text> </xsl:when> <xsl:otherwise> <xsl:variable name="tmp"><xsl:value-of select="$i-1"/></xsl:variable> <xsl:call-template name="test"> <xsl:with-param name="i" select="$tmp"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> En XSLT une variable ne peut pas etre affecter plusieurs fois. Mais dans l'exemple precedent, la variable tmp change bien � chaque appel de valeur. Je suppose qu'� chaque appel une nouvelle variable tmp est cr�ee d'o� le changement de valeur valide. Est-ce correct? merci de votre aide A+ Sydney
Technical Details
Message-ID:
<96g85h$laj$1@vega.worldonline.fr>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!hermes.visi.com!news-out.visi.com!news.tele.dk!193.190.198.17!newsfeeds.belnet.be!news.belnet.be!news.worldonline.fr!not-for-mailReferences:
<96dnk2$13g$1@capella.worldonline.fr> <96f3uo$3h1$1@wanadoo.fr> <wyofw45wr5.fsf@polya.u-strasbg.fr>Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,4a899d71806a4395 X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-02-15 01:50:02 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!hermes.visi.com!news-out.visi.com!news.tele.dk!193.190.198.17!newsfeeds.belnet.be!news.belnet.be!news.worldonline.fr!not-for-mail From: "Sydney" <sydney@ifrance.com> Newsgroups: fr.comp.text.xml Subject: Re: Sommer un calcul Date: Thu, 15 Feb 2001 10:39:03 +0100 Organization: World Online France News server Lines: 46 Message-ID: <96g85h$laj$1@vega.worldonline.fr> References: <96dnk2$13g$1@capella.worldonline.fr> <96f3uo$3h1$1@wanadoo.fr> <wyofw45wr5.fsf@polya.u-strasbg.fr> NNTP-Posting-Host: ppp-10.dialup-7.worldonline.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: vega.worldonline.fr 982230001 21843 213.19.7.10 (15 Feb 2001 09:40:01 GMT) X-Complaints-To: abuse@worldonline.fr NNTP-Posting-Date: 15 Feb 2001 09:40:01 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200