xsl-list
[Top] [All Lists]

Re: font color

2005-07-30 01:51:04
Hi,
Tempore 07:06:45, die 07/30/2005 AD, hinc in 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit 
<jeb501(_at_)sanmargroup(_dot_)com>:

date3's font color should appear in the output as specified in the ctag

ie if ctag="Y" , the font color of date1 in the output is yellow and

similerly if ctag="R", the font color of date3 in the output is red
.......
It's best to use CSS for that:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
<html>
<head>
<style type="text/css">
.Y {color:yellow}
.R {color:red}
.B {color:blue}
</style>
</head>
<body>
<h4>Report 1</h4>
<table border="1" cellpadding="4" cellspacing="0">
<tr bgcolor="#9acd32">
<th>Tag</th>
<th>Date</th>
<th>Hno</th>
<th>Description</th>
<th>Weight </th>
<th>Qty </th>
<th>Rp1 Date</th>
<th>Rp2 Date</th>
<th>Rp3 Date</th>
</tr>
<xsl:for-each select="pitems/record">
<tr>
<xsl:if test="tag1 = 1">
<xsl:attribute name="bgcolor">#ddaadd</xsl:attribute>
</xsl:if>
<xsl:if test="tag1 = 2">
<xsl:attribute name="bgcolor">#ffdd00</xsl:attribute>
</xsl:if>
<td>
<xsl:value-of select="tag" />
</td>
<td>
<xsl:value-of select="date" />
</td>
<td>
<xsl:value-of select="hno" />
</td>
<td>
<xsl:value-of select="desc" />
</td>
<td align="right">
<xsl:value-of select="mqty" />
</td>
<td align="right">
<xsl:value-of select="qty" />
</td>
<td class="{date1/@ctag}">
<xsl:value-of select="date1" />
<xsl:value-of select="date1/@ctag" />
</td>
<td class="{date2/@ctag}">
<xsl:value-of select="date2" />
<xsl:value-of select="date2/@ctag" />
</td>
<td class="{date3/@ctag}">
<xsl:value-of select="date3" />
<xsl:value-of select="date3/@ctag" />
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>


regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Vincit omnia simplicitas
Keep it simple

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>