[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: font color
Joris, Thanks, It works well. Thanks again. Regards Eugene "Joris Gillis" <roac@xxxxxxxxxx> 30-07-2005 02:21 PM Please respond to xsl-list@xxxxxxxxxxxxxxxxxxxxxx To xsl-list@xxxxxxxxxxxxxxxxxxxxxx cc Subject Re: font color Hi, Tempore 07:06:45, die 07/30/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit <jeb501@xxxxxxxxxxxxxxx>: > 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|