|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
<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> <xsl therwise><td><xsl:value-of select="results/total"/></td> </xsl therwise></xsl:choose> </tr> </xsl:for-each> </table> --------------------------------------------------- Any help appreciated Thanks, Sam --------------------------------------------------- |
|
#2
|
|||
|
|||
|
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> |
|
#3
|
|||
|
|||
|
???
Hmmmm, still a little lost. Can you please expand on this.
Thanks in advance Sam |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > <xsl:choose> |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|