Article View: fr.comp.text.xml
Article #9199Re: Need help... Test an element??
From: Lupo
Date: Thu, 10 May 2001 12:26
Date: Thu, 10 May 2001 12:26
104 lines
3888 bytes
3888 bytes
Vincent Berruchon wrote: > > Hi, I'd like to write comments about my data. > for exemple if RecrutNum >0 .. I'd like to write "increase" > RecrutNum =0 .. I'd like to write "no change" > else I'd like to write "decrease" > > I don't understand how to test the value of an element ( RecrutDiscard). > > my .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> > --- > > my .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> arrivals : > <xsl:choose> > <xsl:when test="@RecrutDiscard > 0"> > <xsl:text> > increase of <Font color="red"><xsl:value-of > select="RecrutDiscard"/>%</Font> > <xsl:/text> > </xsl:when> > <xsl:when test="@RecrutDiscard = 0"> > <xsl:text>no change<xsl:text> > </xsl:when> > <xsl:otherwise> > <xsl:text> > decrease <Font color="red"><xsl:value-of > select="RecrutDiscard"/>%</Font> > <xsl:text> > </xsl:otherwise> > </xsl:choose> > since last week</TD> > </TR> > </TABLE> > </xsl:template> > </xsl:stylesheet> > --- > What is the problem? How to test (with if or choose) > > Thanks for your help (if possible, please reply also to vinzzz@noos.fr ) > Vincent Vincent - <xsl:choose> <xsl:when test="number(RecrutDiscard) > 0"> . . . </xsl:when> <xsl:when test="number(RecrutDiscard) = 0"> . . . </xsl:when> <xsl:otherwise> . . . </xsl:otherwise> </xsl:choose> -Lupo
Technical Details
Message-ID:
<3AFA8911.7E192F0A@yahoo.com>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.netscape.com!secnews.netscape.com!secnews.netscape.com!not-for-mailReferences:
<B1uK6.72$aB5.22415@tengri.easynet.fr>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1047a4,92ec00df5e179645 X-Google-Attributes: gid1047a4,public X-Google-Thread: 110868,92ec00df5e179645 X-Google-Attributes: gid110868,public X-Google-Thread: 114f60,92ec00df5e179645 X-Google-Attributes: gid114f60,public X-Google-Thread: 1006ac,92ec00df5e179645 X-Google-Attributes: gid1006ac,public X-Google-ArrivalTime: 2001-05-10 05:28:36 PST Path: arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.netscape.com!secnews.netscape.com!secnews.netscape.com!not-for-mail From: Lupo <tcantalupo@yahoo.com> Newsgroups: fr.comp.text.xml,microsoft.public.xml,microsoft.public.xsl,netscape.public.dev.xml Subject: Re: Need help... Test an element?? Date: Thu, 10 May 2001 08:26:57 -0400 Organization: http://todd.cantalupo.org Lines: 104 Message-ID: <3AFA8911.7E192F0A@yahoo.com> References: <B1uK6.72$aB5.22415@tengri.easynet.fr> NNTP-Posting-Host: 93hdcp145.chordiant.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.77 [en] (WinNT; U) X-Accept-Language: en To: Vincent Berruchon <vinzzz@noos.fr>, vinzzz@noos.fr