Article View: fr.comp.text.xml
Article #10202Re: Supprimer un doublon
From: Rapha�l THERY
Date: Tue, 28 Nov 2000 00:00
Date: Tue, 28 Nov 2000 00:00
47 lines
2812 bytes
2812 bytes
Tout � fait, j'ai fais mes tests avec Stylus qui lui accepte sans probl�me ce que j'ai propos� ... (� merveille, je dirais ) ensuite je mets en production (pour cela j'utiliser xalan) et l� .... BIG Probl�me ! par contre TA SOLUTION r�soud tous mes probl�mes je t'en remercie ! Tom. <ptittom@free.fr> a �crit dans le message : ms9009.ah.ln@ptittom.free.fr... > In article <0kMU5.25$P8.119926@nnrp2.proxad.net>, "Rapha�l THERY" > <raphael.thery@nordnet.fr> wrote: > > <xsl:template match="root"> > > <xsl:element name="Resultat" > > > <xsl:variable name="maVariable" select="" /> > > <xsl:for-each select="*" > > > <xsl:sort select="@nom" order="ascending" /> > > <xsl:if test="$maVariable = @nom"> > > <xsl:apply-templates select="." /> > > </xsl:if> > > <xsl:variable name="maVariable" select="@nom" /> > > </xsl:for-each> > > </xsl:element></xsl:template> > > Si ton processeur XSLT te l'autorise, il n'est pas conforme � la > Recommendation. > In http://www.w3.org/TR/xslt#local-variables : > "It is an error if a binding established by an xsl:variable or > xsl:param element within a template shadows another binding > established by an xsl:variable or xsl:param element also within the > template" > En d'autres termes : il n'y a pas d'affectation en XSLT. Comme > quelqu'un le soulignait sur c.t.x, XSLT est un langage fonctionnel, pas > proc�dural, donc pas d'affectation. > > C'�tait bien un probl�me dans ton xsl:if : > > <xsl:variable name="monNom" select="@nom" /> > > <xsl:if test="not($monNom=//Resultat/Champ[@nom])"> > Tu compares la valeur de l'attribut @nom avec la valeur du premier > Champ qui poss�de un attribute @nom. > > Ce qu'il te faut, c'est plutot savoir si un Champ pr�c�dent avait le > m�me @nom : > <xsl:if test="not(preceding-sibling::Champ[@nom = current()/@nom])" > Est-ce qu'il existe un pr�c�dent Champ ayant le m�me @nom ? S'il n'y en > a pas on "ex�cute" le contenu du xsl:if > > Tom.
Technical Details
Message-ID:
<dQOU5.2402$Pa4.4689003@nnrp6.proxad.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<72MU5.66$Fc.280770@nnrp1.proxad.net> <0kMU5.25$P8.119926@nnrp2.proxad.net> <ms9009.ah.ln@ptittom.free.fr>Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,8a4f3d741be47a82 X-Google-Attributes: gid114f60,public From: "Rapha�l THERY" <raphael.thery@nordnet.fr> Subject: Re: Supprimer un doublon Date: 2000/11/28 Message-ID: <dQOU5.2402$Pa4.4689003@nnrp6.proxad.net> X-Deja-AN: 698676064 References: <72MU5.66$Fc.280770@nnrp1.proxad.net> <0kMU5.25$P8.119926@nnrp2.proxad.net> <ms9009.ah.ln@ptittom.free.fr> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@proxad.net X-Trace: nnrp6.proxad.net 975419785 195.115.154.77 (Tue, 28 Nov 2000 14:56:25 CET) Organization: Guest of ProXad - France X-MSMail-Priority: Normal NNTP-Posting-Date: Tue, 28 Nov 2000 14:56:25 CET Newsgroups: fr.comp.text.xml