Article View: fr.comp.text.xml
Article #9192Help : Test simple
From: Vincent Berruchon
Date: Thu, 10 May 2001 10:20
Date: Thu, 10 May 2001 10:20
79 lines
3274 bytes
3274 bytes
Bonjour, j'aimerais �crire des commentaires en fonctions des donn�es
par exemple:
si RecrutNum >0 .. j'�cris "en hause"
RecrutNum =0 .. j'�cris "aucun changement"
et sinon "en baisse"
Je suis un peu perdu, j'ai essayer diverses choses et j'ai fini par rajouter
des choses probablement inutiles ( @, /, <xsl:/text> )
en fait ce que je ne comprend pas c comment faire un test sur la valeur d'un
�l�ment (ici RecrutDiscard).
le .xml
----
<?xml version="1.0"?>
<Report>
<Id>F2</Id>
<Title></Title>
<DateBeg>23/01/2001 </DateBeg>
<DateEnd>31/01/2001</DateEnd>
<RecrutNum>104</RecrutNum>
<RecrutDiscard>22</RecrutDiscard>
<LostNum>75</LostNum>
<LostDiscard>13</LostDiscard>
</Report>
---
le .xsl:
--------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
</HEAD>
<BODY>
<TABLE width="100%" cellspacing="0">
<TR>
<TD><DIV id="listing"><xsl:apply-templates match="Report"/></DIV></TD>
</TR>
</TABLE>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="Report">
<TABLE STYLE="background-color:white" width="400">
<TR>
<TD colspan="2">Au cours de la semaine du <Font
color="red"><xsl:value-of select="DateBeg"/></Font> au <Font
color="red"><xsl:value-of select="DateEnd"/></Font></TD>
</TR>
<TR>
<TD width="40"></TD><TD><span class="inserted"><xsl:value-of
select="RecrutNum"/></span> arriv�s :
<xsl:choose>
<xsl:when test="@RecrutDiscard > 0">
<xsl:text>
une hausse de <Font color="red"><xsl:value-of
select="RecrutDiscard"/>%</Font>
<xsl:/text>
</xsl:when>
<xsl:when test="@RecrutDiscard = 0">
<xsl:text>aucun changement<xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>
une baisse de <Font color="red"><xsl:value-of
select="RecrutDiscard"/>%</Font>
<xsl:text>
</xsl:otherwise>
</xsl:choose>
par rapport a la semaine derniere,</TD>
</TR>
</TABLE>
</xsl:template>
</xsl:stylesheet>
---
Merci (si possible r�pondre aussi � vinzzz@noos.fr svp)
Vincent
Technical Details
Message-ID:
<9YtK6.71$aB5.29625@tengri.easynet.fr>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!freenix!fdn.fr!teaser.fr!isdnet!easynet-fr!tengri.easynet.fr!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,45a8f7d70e5032ef,start X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-05-10 03:26:18 PST Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!freenix!fdn.fr!teaser.fr!isdnet!easynet-fr!tengri.easynet.fr!not-for-mail From: "Vincent Berruchon" <vinzzz@noos.fr> Newsgroups: fr.comp.text.xml Subject: Help : Test simple Lines: 81 X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Message-ID: <9YtK6.71$aB5.29625@tengri.easynet.fr> Date: Thu, 10 May 2001 12:20:53 +0200 NNTP-Posting-Host: 212.180.93.14 X-Complaints-To: abuse@easynet.fr X-Trace: tengri.easynet.fr 989490053 212.180.93.14 (Thu, 10 May 2001 12:20:53 MET DST) NNTP-Posting-Date: Thu, 10 May 2001 12:20:53 MET DST Organization: [Posted via] Easynet France