XSL/XML网页制作入门,入门到精通[13]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 myali88 的 blog

<q4>10</q4>
</report>
</document>

 


  我们采用xsl模板结合今天所学的<xsl:if>,为其编写一个xsl文档,要求季度产量小于等于20的用红色表示,文件名为report.xsl,内容如下: 

程序代码:
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/tr/wd-xsl">

<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" cellspacing="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>

本文关键:XSL/XML网页制作入门,入门到精通
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top