Article View: fr.comp.text.xml
Article #10100Re: manipulation d'une variable
From: Rapha�l THERY
Date: Wed, 20 Dec 2000 11:01
Date: Wed, 20 Dec 2000 11:01
77 lines
3099 bytes
3099 bytes
Comment cela peut-il marcher ? (sans tenir compte du fait que le parser
respecte la norme)
la vraie �criture est celle-ci
<xsl:sort select="@lang-fr" order="ascending"/>
or cela ne pr�cise pas qu'il s'agit d'un attribut !
<xsl:sort select="{$lang}" order="ascending"/>
�a
<xsl:param name="lang" select="lang-fr" />
ou �a
<xsl:param name="lang">lang-fr</xsl:param>
pour moi c'est la m�me chose
bien qu'en fait j'ai mis
<xsl:param name="lang" select="'lang-fr'" /> <== il y a des ' ' en plus
et le but et que j'arrive � une chose comme cela :
<xsl:param name="lang" select="'fr'" />
...
<xsl:sort select="@lang-{$lang}" order="ascending"/>
...
merci quand m�me !
Aur�lien DEHAY <aurelien.dehay@fret.sncf.fr> a �crit dans le message :
m3ae9rjs1m.fsf@fret.sncf.fr...
> "Rapha�l THERY" <raphael.thery@nordnet.fr> writes:
>
> > Soit un flux XML
> > <dictionnaire>
> > <terme lang-fr="jkljm" lang-en="klmkmklm" ..... />
> > <terme lang-fr="kklfmjkljm" lang-en="klmgdfkmklm" ..... />
> > ....
> > </dictionnaire>
> >
> > je souhaite pouvoir afficher le dictionnaire selon le tri sp�cifi� par
la
> > variable lang.
> > <xsl:param name="lang" select="lang-fr" />
>
> J'aurai plut�t mis (� v�rifier tout de m�me):
>
> <xsl:param name="lang">lang-fr</xsl:param>
>
> >
> > <xsl:template match="dictionnaire">
> > <xsl:copy>
> > <xsl:for-each select="terme">
> > <xsl:sort select="$lang" order="ascending" /> <=== l'erreur est l�
!!
>
> <xsl:sort select="{$lang}" order="ascending"/>
>
> En tout cas, �a �a marche chez moi.
>
> > <xsl:copy-of select="." />
> > </xsl:for-each>
> > </xsl:copy>
> > </xsl:template>
> >
> > Mais une fois de plus il semblerait que je bute sur un truc tout con
!!!!
> > J'ai essay� les { }, les fonctions string(), .... attribute:: ....
> > mais rien n'y fait soit il r�le soit il n'en tient pas compte ! Je ne
vais
> > tout de m�me pas utiliser un xsl:choose ?
> >
> > d'avance merci
> > Rapha�l
> >
> >
> >
> >
>
> --
> Aur�lien
Technical Details
Message-ID:
<pk006.3366$F06.5260388@nnrp6.proxad.net>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!proxad.net!feeder2.proxad.net!nnrp6.proxad.net.POSTED!not-for-mailReferences:
<uM%%5.2806$XW5.9381904@nnrp1.proxad.net> <m3ae9rjs1m.fsf@fret.sncf.fr>Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,771e0e4a20a35205 X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2000-12-20 03:02:07 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!proxad.net!feeder2.proxad.net!nnrp6.proxad.net.POSTED!not-for-mail From: "Rapha�l THERY" <raphael.thery@nordnet.fr> Newsgroups: fr.comp.text.xml References: <uM%%5.2806$XW5.9381904@nnrp1.proxad.net> <m3ae9rjs1m.fsf@fret.sncf.fr> Subject: Re: manipulation d'une variable Lines: 79 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 Message-ID: <pk006.3366$F06.5260388@nnrp6.proxad.net> Date: Wed, 20 Dec 2000 11:01:41 GMT NNTP-Posting-Host: 195.115.154.77 X-Complaints-To: abuse@proxad.net X-Trace: nnrp6.proxad.net 977310101 195.115.154.77 (Wed, 20 Dec 2000 12:01:41 CET) NNTP-Posting-Date: Wed, 20 Dec 2000 12:01:41 CET Organization: Guest of ProXad - France