XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 29th, 2004, 06:21 AM
habibz habibz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 4 habibz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<xsl:choose>

As you can see the red highlighted text is the section that is filled with a background colour of #cccc99 when the results total is greater than 50. I want to highlight the whole row of students who have a result greater than 50, how do I do this??

--------------------------------------------------------
<table border="1">
<tr bgcolor="#c0c0c0">
<th align="left">snum</th>
<th align="left">surname</th>
<th align="left">firstname</th>
<xsl:for-each select="/degree/course/student[1]/results/item">
<th align="left"><xsl:value-of select="@name"/></th>
</xsl:for-each>
<th align="left">total</th>
</tr>

<xsl:for-each select="degree/course/student">
<xsl:sort select="surname"/>

<tr>
<td><xsl:value-of select="snum"/></td>
<td><xsl:value-of select="surname"/></td>
<td><xsl:value-of select="firstname"/></td>
<xsl:for-each select="results/item">
<td><xsl:value-of select="current()" /></td>
</xsl:for-each>

<xsl:choose>
<xsl:when test="results/total > 84">
<td bgcolor="#cccc99">
<xsl:value-of select="results/total"/></td>
</xsl:when>
<xsltherwise>
<td><xsl:value-of select="results/total"/></td>
</xsltherwise>
</xsl:choose>
</tr>

</xsl:for-each>

</table>


---------------------------------------------------
Any help appreciated
Thanks, Sam
---------------------------------------------------

Reply With Quote
  #2  
Old May 30th, 2004, 07:51 PM
The Dark The Dark is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2004
Location: Adelaide, Australia
Posts: 880 The Dark User rank is Lance Corporal (50 - 100 Reputation Level)The Dark User rank is Lance Corporal (50 - 100 Reputation Level)The Dark User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 14 h 15 m 25 sec
Reputation Power: 5
I haven't tried this out, but something like this after the <tr> line might work:

Code:
 <xsl:if test="count (results/item[current() > 50]) != 0">
   <xsl:attribute name="bgcolor">#cccc99</xsl:attribute>
 </xsl:if>  

Reply With Quote
  #3  
Old June 1st, 2004, 08:39 AM
habibz habibz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 4 habibz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
???

Hmmmm, still a little lost. Can you please expand on this.

Thanks in advance
Sam

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > <xsl:choose>


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT