<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  	<head>
	  <style type="text/css">
        .aaa {
        	border-top-width: medium;
        	border-right-width: medium;
        	border-bottom-width: medium;
        	border-left-width: medium;
        	border-top-style: double;
        	border-right-style: none;
        	border-bottom-style: none;
        	border-left-style: none;
        	border-top-color: #333333;
        	border-right-color: #333333;
        	border-bottom-color: #333333;
        	border-left-color: #333333;
        }
        td { font-size: 16px; }
        th { font-family: "黑体"; font-size: 18px;	 }
		</style>
		</head>
  <body>
    <p align="center"><strong><xsl:value-of select="MJ/players/player/setname"/> 成绩单</strong></p>
    <table border="0" cellpadding="5" cellspacing="1" bordercolor="#000000" bgcolor="#ffffff" align="center">
    <tr >
    	<th align="right" bgcolor="#9acd32"></th>
			<xsl:for-each select="MJ/players/player">
				<th width="80" bgcolor="#9acd32" align="right">
					<xsl:value-of select="nikename"/> 
				</th>
			</xsl:for-each>
    </tr>

    <tr>
    	<td align="right">用户：</td>
    	<xsl:for-each select="MJ/players/player">
    		<td align="right">
					<xsl:value-of select="nikename"/>
    		</td>
    	</xsl:for-each>
    </tr>

    <xsl:for-each select="MJ/set/description_sets">
    <xsl:if test="description='实际所得'"><tr height="20"><td/> </tr></xsl:if>
    <tr>
    		<xsl:choose>
    			<xsl:when test="description='实际所得'"><td class="aaa" height="30" align="right"><strong><xsl:value-of select="description"/>：</strong></td></xsl:when>
    			<xsl:when test="description='当前余额'"><td align="right"><strong><xsl:value-of select="description"/>：</strong></td></xsl:when>
    			<xsl:when test="description='总计'"></xsl:when>
    			<xsl:otherwise><td align="right"><xsl:value-of select="description"/>：</td></xsl:otherwise>
				</xsl:choose>
      <xsl:for-each select="res">
      	<xsl:choose>
      		<xsl:when test="../description='实际所得'">
	      		<td class="aaa" align="right">
	      			<xsl:choose>
    					<xsl:when test=". &gt; 0"><strong><font color="#009944"><xsl:value-of select="."/></font></strong></xsl:when>
    					<xsl:otherwise><strong><font color="#FF0000"><xsl:value-of select="."/></font></strong></xsl:otherwise>
							</xsl:choose>	      		
	      		</td>
	      	</xsl:when>
	      	<xsl:when test="../description='当前余额'">
	      		<td align="right"><strong><font color="#000088"><xsl:value-of select="."/></font></strong></td>
	      	</xsl:when>
	      	<xsl:when test="../description='总计'">
	      		<td align="right"></td>
	      	</xsl:when>
	      	<xsl:otherwise>
            <td align="right"><xsl:value-of select="."/></td>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </tr>
    </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>
