我随意查看csdn上的一篇帖子的原代码,然后它的内容保存下来,想自己写一个xsl去解析它,IE显示如下错误信息:
无法显示 XML 页。
使用 XSL 样式表无法查看 XML 输入。请更正错误然后单击 刷新按钮,或以后重试。
--------------------------------------------------------------------------------
结束标记 'td' 与开始标记 'xsl:value-of' 不匹配。处理资源 'file:///C:/Documents and Settings/oneway/桌面/ddv/topic.xsl' 时出错。第 17 行,位置: 37
1<td><xsl:value-of select="rank"></xsl:value-of></td>
------------------------------------^
我的xsl代码如下:
1<xsl:stylesheet xmlns="http://www.w3.org/TR/REC-html40" xmlns:xsl="http://www.w3.org/1999/xsl/Transform">
2<xsl:template>
3<xsl:apply-templates></xsl:apply-templates>
4</xsl:template>
5<xsl:template match="/">
6<html>
7<xsl:apply-templates select="/topic/issue/"></xsl:apply-templates>
8</html>
9</xsl:template>
10<xsl:template match="/topic/issue">
11<table border="1">
12<tr>
13<td><xsl:value-of select="rank"></xsl:value-of></td>
14</tr>
15</table>
16</xsl:template>
17</xsl:stylesheet>
---------------------------------------------------------------
try
1<xsl:value-of select="rank"></xsl:value-of>
---------------------------------------------------------------
标记要关闭
同意楼上的