<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<head>
<title>1999年生产统计</title>
</head>
<body>
<xsl:apply-templates select="document"/>
</body>
</html>
</xsl:template>
<xsl:template match="document">
<h3>1999年生产统计</h3>
<TABLE border="1" width="100%" cellpadding="0">
<TH>班组</TH>
<TH>一季度</TH>
<TH>二季度</TH>
<TH>三季度</TH>
<TH>四季度</TH>
<xsl:apply-templates select="report"/>
</TABLE>
</xsl:template>
<xsl:template match="report">
<TR>
<TD><xsl:value-of select="class"/></TD>
<TD><xsl:apply-templates select="q1"/></TD>
<TD><xsl:apply-templates select="q2"/></TD>
<TD><xsl:apply-templates select="q3"/></TD>
<TD><xsl:apply-templates select="q4"/></TD>
</TR>
</xsl:template>
<xsl:template match="q1|q2|q3|q4">
<xsl:if test="text()&lt;20">
<xsl:attribute name="style">color:red</xsl:attribute>
</xsl:if>
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
这样应该就可以了