我作了个xsl来显示csdn的帖子,请帮忙看看有什么毛病?谢谢!
本人昨天刚刚学了一点xsl的概念,忽然想作一个xsl文件来显示以前保存的csdn的帖子.但是,一调试就出问题了,我怎么也找不到错误,请大家帮我看看!多谢!
文件名取名为csdn.xsl,内容如下:
<?xml version="1.0" encoding="GB2312" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR-WD-xsl">
<!--根模板-->
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>CSDN论坛精华贴</TITLE>
</HEAD>
<BODY>
<xsl:apply-templates select="Topic" />
</BODY>
</HTML>
</xsl:template>
<!--主题模板-->
<xsl:template match="Topic">
<table border="1">
<tr>
<td>
<xsl:apply-templates select="Issue" />
</td>
</tr>
<tr>
<td>
<xsl:apply-templates select="Replys" />
</td>
</tr>
</table>
</xsl:template>
<!--问题模板-->
<xsl:template match="Issue">
<table border="0">
<tr>
<td>主题:</td>
<td>
<xsl:apply-templates select="Topic/Issue/TopicName" />
</td>
</tr>
<tr>
<td>作者:</td>
<td>
<xsl:apply-templates select="Topic/Issue/PostUserID" />
(<xsl:apply-templates select="Topic/Issue/PostUserNickName" />)
</td>
</tr>
<tr>
<td>等级:</td>
<td>
<xsl:apply-templates select="Topic/Issue/ranknum" />
</td>
</tr>
<tr>
<td>信誉值:</td>
<td>
<xsl:apply-templates select="Topic/Issue/credit" />
</td>
</tr>
<tr>
<td>所属论坛:</td>
<td>
<xsl:apply-templates select="Topic/Issue/RoomName" />
</td>
</tr>
<tr>
<td>问题点数:</td>
<td>
<xsl:apply-templates select="Topic/Issue/Point" />
</td>
</tr>
<tr>
<td>回复次数:</td>
<td>
<xsl:apply-templates select="Topic/Issue/ReplyNum" />
</td>
</tr>
<tr>
<td>发表时间:</td>
<td>
<xsl:apply-templates select="Topic/Issue/PostDateTime" />
</td>
</tr>
</table>
</xsl:template>
<!--主题模板-->
<xsl:template match="Topic/Issue/TopicName">
<xsl:value-of />
</xsl:template>
<!--发贴人ID模板-->
<xsl:template match="Topic/Issue/PostUserID">
<xsl:value-of />
</xsl:template>
<!--发贴人呢称模板-->
<xsl:template match="Topic/Issue/PostUserNickName">
<xsl:value-of />
</xsl:template>
<!--等级模板-->
<xsl:template match="Topic/Issue/ranknum">
<xsl:value-of />
</xsl:template>
<!--信誉值模板-->
<xsl:template match="Topic/Issue/credit">
<xsl:value-of />
</xsl:template>
<!--所属论坛模板-->
<xsl:template match="Topic/Issue/RoomName">
<xsl:value-of />
</xsl:template>
<!--点数模板-->
<xsl:template match="Topic/Issue/Point">
<xsl:value-of />
</xsl:template>
<!--回复数模板-->
<xsl:template match="Topic/Issue/ReplyNum">
<xsl:value-of />
</xsl:template>
<!--发表时间模板-->
<xsl:template match="Topic/Issue/PostDateTime">
<xsl:value-of />
</xsl:template>
<!--所有回复模板-->
<xsl:template match="Topic/Replys">
<table border="0">
<xsl:for-each select="Topic/Replys/Reply">
<xsl:apply-templates select="Topic/Replys/Reply" />
</xsl:for-each>
</table>
</xsl:template>
<!--回复模板-->
<xsl:template match="Topic/Replys/Reply">
<tr bgcolor="#ffff00">
<td>
回复人:
<xsl:apply-templates select="Topic/Replys/Reply/PostUserID" />
(<xsl:apply-templates select="Topic/Replys/Reply/PostUserNickName" />)
(<xsl:apply-templates select="Topic/Replys/Reply/ranknum" />)
信誉:
(<xsl:apply-templates select="Topic/Replys/Reply/credit" />)
<xsl:apply-templates select="Topic/Replys/Reply/PostDateTime" />
得分:
<xsl:apply-templates select="Topic/Replys/Reply/Point" />
</td>
</tr>
<tr>
<td>
<xsl:apply-templates select="Topic/Replys/Reply/Content" />
</td>
</tr>
</xsl:template>
<!--回复人ID模板-->
<xsl:template match="Topic/Replys/Reply/PostUserID" />
<xsl:value-of />
</xsl:template> ---------------------->这里是第167行,错误!
<!--回复人呢称模板-->
<xsl:template match="Topic/Replys/Reply/PostUserNickName" />
<xsl:value-of />
</xsl:template>
<!--回复人等级模板-->
<xsl:template match="Topic/Replys/Reply/ranknum" />
<xsl:value-of />
</xsl:template>
<!--回复人信誉值模板-->
<xsl:template match="Topic/Replys/Reply/credit" />
<xsl:value-of />
</xsl:template>
<!--回复日期时间模板-->
<xsl:template match="Topic/Replys/Reply/PostDateTime" />
<xsl:value-of />
</xsl:template>
<!--回复人得分模板-->
<xsl:template match="Topic/Replys/Reply/Point" />
<xsl:value-of />
</xsl:template>
<!--回复内容模板-->
<xsl:template match="Topic/Replys/Reply/Content" />
<xsl:value-of />
</xsl:template>
</xsl:stylesheet>
双击我要显示的xml文档后,出现了如下错误提示:
无法显示 XML 页。
使用 XSL 样式表无法查看 XML 输入。请更正错误然后单击 刷新按钮,或以后重试。
--------------------------------------------------------------------------------
结束标记 'xsl:template' 与开始标记 'xsl:stylesheet' 不匹配。处理资源 'file:///G:/参考/xml/code/csdn.xsl' 时出错。第 167 行,位置: 3
</xsl:template>
--^
错误的位置我已经标出来了,请各位高手帮我看看:)