除错,xml数据显示 有个问题,有中文,用GB2312试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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() > 90]"><xsl:attribute name="style">color:red</xsl:attribute> </xsl:when><!-- 如果成绩大于等于90则添加一STYLE属性color,其值为red(红色)--> <xsl:when test=".[value() < 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>顺便问一句,你是北大青鸟的吗? jsp利用组件上传图片 求一份 表单!!在线等! 求SSH框架中DAO层的HQL语句书写 关于xfire的webservice的客户端 谁能用一个形象的例子给具体解释一下String和toString的用法,区别? 简单hibernate映射文件问题 J2EE项目的main方法在哪里? struts问题急(forward 问题, 在线) tomcat5.5.4的日志问题 struts中的logic:iterate如何使用????急 求助,JSP文件上传问题!!! 请列举有关java的开源社区
<?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() > 90]"><xsl:attribute name="style">color:red</xsl:attribute> </xsl:when><!-- 如果成绩大于等于90则添加一STYLE属性color,其值为red(红色)-->
<xsl:when test=".[value() < 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>顺便问一句,你是北大青鸟的吗?