有个问题,有中文,用GB2312试试

解决方案 »

  1.   

    xsl代码:
    <?xml version="1.0" encoding="gb2312"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
    <xsl:template match="/">
    <html>
    <head><title>成绩表</title></head>
    <body><h2 align="center">学生成绩表</h2>
    <xsl:apply-templates select="学生成绩表"/>
    </body>
    </html>
    </xsl:template><xsl:template match="学生成绩表">
    <table align="center" border="1" cellpadding="0">
    <tr>
    <th>学号</th><th>姓名</th><th>Java</th><th>Oracle</th><th>VisualBasic</th>
    </tr>
    <xsl:apply-templates select="学生"/>
    </table>
    </xsl:template><xsl:template match="学生">
    <tr>
    <td><xsl:apply-templates select="学号"/></td>
    <td><xsl:apply-templates select="姓名"/></td>
    <td align="right"><xsl:apply-templates select="Java"/></td>
    <td align="right"><xsl:apply-templates select="Oracle"/></td>
    <td align="right"><xsl:apply-templates select="VisualBasic"/></td>
    </tr>
    </xsl:template> <xsl:template match="学号"><xsl:value-of /></xsl:template>
    <xsl:template match="姓名"><xsl:value-of /></xsl:template><xsl:template match="Java|Oracle|VisualBasic">
    <xsl:choose>
    <xsl:when test=".[value() &gt; 90]"><xsl:attribute name="style">color:red</xsl:attribute>  </xsl:when><!-- 如果成绩大于等于90则添加一STYLE属性color,其值为red(红色)-->
    <xsl:when test=".[value() &lt; 60]"><xsl:attribute name="style">color:blue</xsl:attribute>  </xsl:when>
    <xsl:otherwise><xsl:attribute name="style">color:black</xsl:attribute></xsl:otherwise>
    </xsl:choose>
     <xsl:value-of/> 
    </xsl:template></xsl:stylesheet>顺便问一句,你是北大青鸟的吗?