🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #10577

Re: Sommes complexes en XML/XSL

#10577
From: thm
Date: Mon, 11 Sep 2000 15:35
53 lines
2609 bytes
et si tu essaie MathML, c'est fait pour
A+
ThM
xml@idocw.com
http://www.idocw.com

Alain Ketterlin <alain@dpt-info.u-strasbg.fr> wrote in message
news:wyr96wkx7d.fsf@polya.u-strasbg.fr...
>
> Salut a tous,
>
> Voici mon document :
>
> <top>
>   <couple> <x>1</x> <y>2</y> </couple>
>   <couple> <x>2</x> <y>5</y> </couple>
>   ...
> </top>
>
> J'aimerais en XSL calculer la somme des x*y (il peut y avoir un nombre
> quelconque de <couples>). (Bon en fait, mon probleme est plus
> complique, mais se ramene a ca).
>
> La seule solution que j'ai trouvee est une horreur du style :
>
>   <xsl:template match="couple">
>     <xsl:param name="somme">
>     <xsl:variable name="nsomme" select="$somme+number(x)*number(y)"/>
>     <xsl:choose>
>       <xsl:when test="following::couple">
>         <xsl:apply-templates select="following::couple">
>           <xsl:with-param name="somme" select="$nsomme"/>
>         </xsl:template>
>       </xsl:when>
>       <xsl:otherwise>
>         <xsl:value-of select="$nsomme"/>
>       </xsl:otherwise>
>     </xsl:choose>
>   </xsl:template>
>
> (approximativement, je tape de memoire, je n'ai pas la feuille XSL
> sous le clavier)
>
> Soit une iteration sur les elements <couple>. Tres nettement
> suboptimal parce que j'ai d'autres elements couple dans le document,
> et j'aimerais restreindre a un sous-arbre.
>
> Si quelqu'un a une meilleure idee, je suis preneur.
>
> -- Alain.
>
> P/S : je n'ai qu'episodiquement acces aux news, donc un CC: a
> alain@dpt-info.u-strasbg.fr serait sympa si c'est possible. Merci.
Technical Details
Message-ID: <8piu78$19lt$1@news4.isdnet.net>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-east!supernews.com!195.162.196.200.MISMATCH!news.grmbl.tm!news.tvd.be!newsfeed.nettuno.it!bignews.mediaways.net!newsfeeds.belnet.be!news.belnet.be!isdnet!isdnethub!not-for-mail
References: <wyr96wkx7d.fsf@polya.u-strasbg.fr>

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII-7-bit
X-Google-Thread: 114f60,b8d0ec6833880a
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2000-09-11 08:38:09 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-east!supernews.com!195.162.196.200.MISMATCH!news.grmbl.tm!news.tvd.be!newsfeed.nettuno.it!bignews.mediaways.net!newsfeeds.belnet.be!news.belnet.be!isdnet!isdnethub!not-for-mail
From: "thm" <tmadillo@francenet.fr>
Newsgroups: fr.comp.text.xml
Subject: Re: Sommes complexes en XML/XSL
Date: Mon, 11 Sep 2000 17:35:42 +0200
Lines: 55
Message-ID: <8piu78$19lt$1@news4.isdnet.net>
References: <wyr96wkx7d.fsf@polya.u-strasbg.fr>
NNTP-Posting-Host: pppa176.francenet.fr
X-Trace: news4.isdnet.net 968686632 42685 193.149.100.86 (11 Sep 2000 15:37:12 GMT)
X-Complaints-To: abuse@isdnet.net
NNTP-Posting-Date: 11 Sep 2000 15:37:12 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300