-- 作者:lzxiangz
-- 发布时间:8/19/2008 11:07:00 PM
-- [原创] 使用XSL转换XML文档 载入样式表单出错 分析 XSLT 样式表单失败。
使用XSL转换XML文档 载入样式表单出错 分析 XSLT 样式表单失败。是什么原因呢? (1)Student.xml <?xml version="1.0" encoding="gb2312" ?> <!-- File Name:Student.xml --> <?xml-stylesheet type="text/xsl" href="Student_01.xsl " ?> <roster> <student class="金融"> <SN>2005133110</SN> <name>张列</name> <sex>男</sex> <birthday>1986.10.21</birthday> <score>605</score> </student> <student class="金融"> <SN>2005133115</SN> <name>吴茗芳</name> <sex>女</sex> <birthday>1985.8.25</birthday> <score>596</score> </student> <student class="国际金融"> <SN>2005131136</SN> <name>周颖</name> <sex>女</sex> <birthday>1986.5.28</birthday> <score>611</score> </student> <student class="保险"> <SN>2005132012</SN> <name>陈旭东</name> <sex>男</sex> <birthday>1986.6.19</birthday> <score>602</score> </student> <student class="金融"> <SN>2005133108</SN> <name>夏凡</name> <sex>女</sex> <birthday>1987.3.15</birthday> <score>581</score> </student> </roster> (2)Student_01.xsl <?xml version="1.0" encoding="gb2312" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/tr/wd-xsl"> <!-- File Name:Student_01.xsl --> <xsl:template match="/"> <h3 align="center">2005级金融系学生信息</h3> <table border="1" bgcolor="#4EB7DE" align="center"> <tr> <th>学号</th><th>姓名</th> <th>性别</th><th>生日</th><th>入学成绩</th> </tr> <xsl:for-each select="roster/student" order-by="-score"> <tr align="center"> <td><xsl:value-of select="SN"/></td> <td><xsl:value-of select="name"/></td> <td><xsl:value-of select="sex"/></td> <td><xsl:value-of select="birthday"/></td> <td><xsl:value-of select="score"/></td> </tr> </xsl:for-each> </table> </xsl:template> </xsl:stylesheet>
|