有一下xml文件:
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="rss.xslt" media="screen"?>
<rss version="2.0">
<channel>
<title>宁波市鄞州区统计网</title>
<link>http://localhost:1757/</link>
<description>Latest 20 threads</description>
<copyright>Copyright (c) 宁波市鄞州区统计网</copyright>
<generator>宁波市鄞州区统计网</generator>
<pubDate>Tue, 27 Apr 2010 16:17:59 GMT</pubDate>
<ttl>3600</ttl>
<item>
<title>塘溪镇将人普工作列入年度十大重点工作</title>
<description>
<![CDATA[
<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch]]>
</description>
<link>http://localhost:1757/Page/ListPage.aspx?ListID=12712&ModuleID=374 </link>
<category>林祖伟</category>
<author>林祖伟</author>
<pubDate>Tue, 13 Apr 2010 16:36:00 GMT</pubDate>
</item>
</channel>
</rss>
我想通过rss.xslt文件将该xml数据转化为html
在rss.xslt文件中该怎么些呀?高人指点一下
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="rss.xslt" media="screen"?>
<rss version="2.0">
<channel>
<title>宁波市鄞州区统计网</title>
<link>http://localhost:1757/</link>
<description>Latest 20 threads</description>
<copyright>Copyright (c) 宁波市鄞州区统计网</copyright>
<generator>宁波市鄞州区统计网</generator>
<pubDate>Tue, 27 Apr 2010 16:17:59 GMT</pubDate>
<ttl>3600</ttl>
<item>
<title>塘溪镇将人普工作列入年度十大重点工作</title>
<description>
<![CDATA[
<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch]]>
</description>
<link>http://localhost:1757/Page/ListPage.aspx?ListID=12712&ModuleID=374 </link>
<category>林祖伟</category>
<author>林祖伟</author>
<pubDate>Tue, 13 Apr 2010 16:36:00 GMT</pubDate>
</item>
</channel>
</rss>
我想通过rss.xslt文件将该xml数据转化为html
在rss.xslt文件中该怎么些呀?高人指点一下
解决方案 »
- gridview的更新问题。
- 巨郁闷,asp.net连接数据库疑惑
- 一个很奇怪的小问题?
- 提问:Visual .Net和SourceSafe 6.0C都已经安装成功,为什么我的源代码管理器出错
- 请问能否实现这样一个较特殊的Button控件?
- 如何实现多个Web窗体之间的参数传递?
- 我用asp.net发送邮件,使用iis的smtp服务,但是发送有问题,要发好多次才有可能收到一次??
- 调查
- 急]高分求交友源码.看了后合适在加100分
- 放置在WEB From上的服务器端控件在运行时不能显示在页面上,并确按F5无法调试触发页面的装载事件,已经重装了n次iis,请大家帮我开一下,
- PowerDesigner生成的脚本在sql2005查询分析器运行出错了?
- 怎样访问loginview里的控件
通过3层遍历
然后 StriBuilder连接就行了。
或者使用Stream直接读取文件 过滤掉标签
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" version="1.0" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<xsl:call-template name="rt"/>
</xsl:template>
<xsl:template name="rt">
<html>
<body>
<table>
<tr>
<td>
<xsl:value-of select="//channel/title"/>
</td>
<td>
<xsl:value-of select="//channel/link"/>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>