(散分)用了一个月左右,总算完成了一个简易的Rss浏览器。

happydivid 2006-11-12 11:29:03
感谢过程中帮助过的朋友,谢谢!
顺便拜师,有没有愿意收徒弟啊!
...全文
211 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
lavendergo 2006-11-15
  • 打赏
  • 举报
回复
lz严重了,我大学毕业的毕业设计也是rss阅读器,对这个还熟悉一些.
msn: jjunix@hotmail.com
有问题可以交流,其他的不敢当
lavendergo 2006-11-13
  • 打赏
  • 举报
回复
我花几分钟用xsl写了个很简单的.

xml这样写
<?xml version="1.0" encoding="gbk"?>
<?xml-stylesheet type="text/xsl" href="reader.xsl"?>
<root>
</root>

下面的存为 reader.xsl 并与上面的xml放于同一个目录下,试试看吧!! 呵呵

<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html" encoding="gb2312" indent="yes" media-type="text/html"/>

<xsl:variable name="channel"

select="document('http://www-128.ibm.com/developerworks/cn/views/rss/customrssatom.jsp?zone_by=Web+services&type_by=Artic

les&type_by=Tutorials&search_by=&max_entries=50&feed_by=rss')/rss/channel"/>
<!-- SOA and Web services -->

<xsl:template match="/">
<xsl:variable name="pageUrl" select="$channel/link"/>
<html>
<head>
<title><xsl:value-of select="title"/></title>
<style type="text/css">
a:link {text-decoration:none;color:#001592}
a:visited {text-decoration:none;color:#001592}
a:hover {text-decoration:none;color:#6D005C}
body{
font-size:12px;
font-family:verdana;
}
</style>
</head>
<body style="font-family:verdana;font-size:12px;color:silver">
<table width="100%">
<tr>
<td style="font-family:verdana;font-size:18px;color:black;font-weight:bold">
<a href="{$pageUrl}" target="_blank"><xsl:value-of select="$channel/title"/></a></td>
</tr>
<tr>
<td style="font-family:verdana;font-size:12px;color:black">-- <xsl:value-of

select="$channel/description"/></td>
</tr>
<tr>
<td align="left" style="font-family:verdana;font-size:12px;color:black"><xsl:value-of

select="$channel/pubDate"/></td>
</tr>
</table>

<xsl:call-template name="getOne"/>
</body>
</html>
</xsl:template>

<xsl:template name="getOne">
<table style="font-family:verdana;font-size:12px;color:silver" border="0" width="90%">
<xsl:for-each select="$channel/item">
<xsl:variable name="href" select="link"/>
<tr>
<td colspan="2">
<span style="font-family:verdana;font-size:15px;"><a href="{$href}"

target="_blank"><xsl:value-of select="title"/></a></span>
</td>
</tr>
<tr>
<td width="5%"></td>
<td>
<span style="font-family:verdana;font-size:13px;color:#666666"><xsl:value-of

select="description"/></span>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
happydivid 2006-11-13
  • 打赏
  • 举报
回复
不对,应该还有java
happydivid 2006-11-13
  • 打赏
  • 举报
回复
lavendergo(王者归来),哈哈,高手!!!以后可以教我xml编程吗?
ker79 2006-11-13
  • 打赏
  • 举报
回复
jf
bign_hdl 2006-11-13
  • 打赏
  • 举报
回复
恭喜
xiaoyur1016 2006-11-12
  • 打赏
  • 举报
回复
jf
dashi 2006-11-12
  • 打赏
  • 举报
回复
up
happydivid 2006-11-12
  • 打赏
  • 举报
回复
对了,有兴趣朋友可以到这个地址去下载试用,源代码:
http://happydivid.blog.ccidnet.com/blog/ccid/do_showone/tid_103972.html

核心就是读取web服务器上的rss文件,生成本地xml文件,然后解析

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧