🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Debutant XML XSL

#9430
From: Tom.
Date: Thu, 05 Apr 2001 15:40
54 lines
2317 bytes
In <9ahvar$5dpl3$1@ID-33075.news.dfncis.de>, Thomas RECLOUX wrote:

> Bonjour � tous, je debute en XSL et j'aimerai faire une transformation
> assez simple de XML vers HTML
> 
> en gros j'ai une structure de description d'adresse qui contient notamment
> un pays, a l'affichage, si le pays est la france, il faut cocher un radio
> boutton et un autre sinon.
> 
> structure XML
> <ADRESSE>
>     <PAYS>
>         FRANCE
>     </PAYS>
>     ....
> </ADRESSE>

Premi�re remarque, la "valeur" de PAYS n'est pas "FRANCE" mais "(plein de 
blancs)FRANCE(plein de blancs)". �a rend la comparaison un peu diff�rente.

> HTML : si pays = FRANCE
> <INPUT TYPE="RADIO" CHECKED="true"/>
> Francaise
> <INPUT TYPE="RADIO" />
> Etrangere
> 
> 
> sinon :
> <INPUT TYPE="RADIO"/>
> Francaise
> <INPUT TYPE="RADIO" CHECKED="true" />
> Etrangere
> 
> Je vois vraimment pas comment faire . Merci d'avance

Si PAYS='FRANCE' Alors
  input checked="checked" Fran�aise
  input �trang�re
Sinon
  input Fran�aise
  input checked="checked" �trang�re
FinSi

Soit en d'autres termes :

input (Si PAYS='FRANCE' Alors checked="checked") Fran�aise
input (Si Pays!='FRANCE' Alors checked="checked") �trang�re

� faire avec un xsl:choose pour la premi�re m�thode ou des xsl:if pour la 
deuxi�me.
xsl:attribute pour cr�er l'attribut.
normalize-space() pour enlever tous les blancs dans PAYS

Tom.
Technical Details
Message-ID: <Xl0z6.544$Vf2.1468479@nnrp5.proxad.net>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!proxad.net!feeder2.proxad.net!nnrp5.proxad.net.POSTED!not-for-mail
References: <9ahvar$5dpl3$1@ID-33075.news.dfncis.de>

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII
X-Google-Thread: 114f60,1eccdd9c99059d7d
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-04-05 08:42:05 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!proxad.net!feeder2.proxad.net!nnrp5.proxad.net.POSTED!not-for-mail
From: Tom. <ptittom+news@free.fr>
Subject: Re: Debutant XML XSL
Newsgroups: fr.comp.text.xml
References: <9ahvar$5dpl3$1@ID-33075.news.dfncis.de>
Lines: 54
Organization: -
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8Bit
Message-ID: <Xl0z6.544$Vf2.1468479@nnrp5.proxad.net>
Date: Thu, 05 Apr 2001 15:40:39 GMT
NNTP-Posting-Host: 193.252.183.232
X-Complaints-To: abuse@proxad.net
X-Trace: nnrp5.proxad.net 986485239 193.252.183.232 (Thu, 05 Apr 2001 17:40:39 CEST)
NNTP-Posting-Date: Thu, 05 Apr 2001 17:40:39 CEST