Article View: fr.comp.text.xml
Article #8260Re: pair/impair
From: Thomas Broyer
Date: Wed, 07 Nov 2001 17:55
Date: Wed, 07 Nov 2001 17:55
36 lines
2160 bytes
2160 bytes
In <3be93790$0$32063$626a54ce@news.free.fr>, vallot@yahoo.com wrote: > un truc b�te. je veux appliquer un <template match="foo"> de fa�on > diff�rente pour les instances paires et impaires. > > au d�part j'ai fait un truc comme �a: > <xsl:template match="foo"> > <xsl:variable name="oddeven"><xsl:value-of > select="count(preceding-sibling::foo) mod 2"/></xsl:variable> > <!-- snip --> > </xsl:template> > > et �a fonctionnait au poil. > > maintenant, j'ai eu l'heureuse id�e de trier, i.e. dans le template > "appelant", j'ai mis: > <xsl:apply-templates> > <xsl:sort select="@name"/> > </xsl:apply-templates> > > et l�, padbol, la variable correspond au modulo 2 dans l'arbre, mais pas > dans l'ordre d'apparition :( > > suis-je clair ? > > une id�e ? Commencer par enlever tous ces <br /> dans ton message parce que c'est compl�tement illisible. Si tu n'as que des �l�ments �foo� s�lectionn�s (m�me pas un seul noeud de texte, donc mieux vaut l'indiquer explicitement via un select="foo"), tu peux utiliser position() Sinon je vois pas, � part bien s�r utiliser une extension... Tom.
Technical Details
Message-ID:
<2280012.SPkdTlGXAF@ltgt.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!proxad.net!feeder2-1.proxad.net!news2-2.free.fr!not-for-mailReferences:
<3be93790$0$32063$626a54ce@news.free.fr>Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,6cfd994223d78707 X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-11-07 09:47:18 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!proxad.net!feeder2-1.proxad.net!news2-2.free.fr!not-for-mail Message-ID: <2280012.SPkdTlGXAF@ltgt.net> From: Thomas Broyer <tbroyer@domain.tld.invalid> Subject: Re: pair/impair Newsgroups: fr.comp.text.xml Reply-To: tbroyer-usenet@ltgt.net Mail-Copies-To: nobody Date: Wed, 07 Nov 2001 18:55:04 +0100 References: <3be93790$0$32063$626a54ce@news.free.fr> Organization: </> User-Agent: KNode/0.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8Bit Lines: 36 NNTP-Posting-Date: 07 Nov 2001 18:47:17 MET NNTP-Posting-Host: 80.11.37.68 X-Trace: 1005155237 news2-2.free.fr 9965 80.11.37.68 X-Complaints-To: abuse@proxad.net