80
最 新 评 论
80
专 题 分 类
80
最 新 日 志
80
最 新 留 言
80
搜 索
用 户 登 录
友 情 连 接
我 的 好 友
80
博 客 信 息
80


XML 应用在RSS中 | 2008/12/28 23:34:00
        RSS是2004年最热门的互联网词汇之一,不过,相对博客(BLOG)来说,RSS的知名度相应会低很多,而且至今还没有一个非常贴切的中文词汇,也许以后无需中文名,大家都习惯于直接叫RSS了。RSS之所以同BLOG一样会被认为是热门词汇的一个原因,个人推测,应该是许多分析人士认识到RSS将要对互联网内容的浏览方法所产生的巨大影响。
       什么是RSS呢?RSS(Really Simple Syndication)是一种描述和同步网站内容的格式,是目前使用最广泛的XML应用。RSS搭建了信息迅速传播的一个技术平台,使得每个人都成为潜在的信息提供者。发布一个RSS文件后,这个RSS Feed中包含的信息就能直接被其他站点调用,而且由于这些数据都是标准的XML格式,所以也能在其他的终端和服务中使用。 如果从RSS阅读者的角度来看,完全不必考虑它到底是什么意思,只要简单地理解为一种方便的信息获取工具就可以了。RSS获取信息的模式与加入邮件列表(如电子杂志和新闻邮件)获取信息有一定的相似之处,也就是可以不必登录各个提供信息的网站而通过客户端浏览方式(称为“RSS阅读器”)或者在线RSS阅读方式这些内容。 例如,通过一个RSS阅读器,可以同时浏览新浪新闻,也可以浏览搜狐或者百度的新闻(如果你采用了RSS订阅的话)。 在许多新闻信息服务类网站,会看到这样的按钮 ,有的网站使用一个图标,有的同时使用两个,这就是典型的提供RSS订阅的标志,这个图标一般链接到订阅RSS信息源的URL。当然,即使不用这样的图标也是可以的,只要提供订阅RSS信息源的URL即可,如本博客提供的RSS订阅URL是:http://www.applicationstar.com/blog/u/liumingtao/rss2.xml 使用RSS获取信息的前提是,先安装一个RSS阅读器,然后将提供RSS服务的网站加入到RSS阅读器的频道即可。大部分RSS阅读器本身也预设了部分RSS频道,如新浪新闻、百度新闻等。

【RSS基础知识】:如何利用RSS阅读器订阅RSS新闻内容?如何免费下载RSS阅读器?
【RSS实用知识】:关于RSS订阅与RSS阅读的常见问题解答
【RSS及其发展历程简介】:
  RSS是一种描述和同步网站内容的格式,是目前使用最广泛的XML应用。RSS应用在国外已经非常普遍,从个人博客(Blog)栏目、企业站点到世界级的门户都提供基于RSS的服务,如IBM公司站点的中文新闻RSS http://www.ibm.com/news/cn/zh/index.rss ,YAHOO站点的http://news.yahoo.com/rss ,微软MSDN站点的http://msdn.microsoft.com/aboutmsdn/rss.asp 等等。

1、 RSS的历史
        那么RSS究竟代表什么呢?比较普遍的有两种说法,一种是“Rich Site Summary”或“RDF Site Summary”,另一种是“Really Simple Syndication”,之所以有这些分歧,需要从RSS发展的历史说起。
  最初的0.90版本RSS是由Netscape公司设计的,目的是用来建立一个整合了各主要新闻站点内容的门户,但是0.90版本的RSS规范过于复杂,而一个简化的RSS 0.91版本也随着Netscape公司对该项目的放弃而于2000年暂停。
  不久,一家专门从事博客写作软件开发的公司UserLand接手了RSS 0.91版本的发展,并把它作为其博客写作软件的基础功能之一继续开发,逐步推出了0.92、0.93和0.94版本。随着网络博客的流行,RSS作为一种基本的功能也被越来越多的网站和博客软件支持。
  在UserLand公司接手并不断开发RSS的同时,很多的专业人士认识到需要通过一个第三方、非商业的组织,把RSS发展成为一个通用的规范,并进一步标准化。于是2001年一个联合小组在0.90版本RSS的开发原则下,以W3C新一代的语义网技术RDF(Resource Description Framework)为基础,对RSS进行了重新定义,发布RSS1.0,并将RSS定义为“RDF Site Summary”。但是这项工作没有与UserLand公司进行有效的沟通,UserLand公司也不承认RSS 1.0的有效性,并坚持按照自己的设想进一步开发出RSS的后续版本,到2002年9月发布了最新版本RSS 2.0,UserLand公司将RSS定义为“Really Simple Syndication”。
    目前RSS已经分化为RSS 0.9x/2.0和RSS 1.0两个阵营,由于分歧的存在和RSS 0.9x/2.0的广泛应用现状,RSS 1.0还没有成为标准化组织的真正标准。
 
2、 RSS目前的版本和推荐
  到目前为止,RSS共有七种版本,推荐使用的是RSS 1.0和RSS 2.0,对于一些基本的站点同步,也可以选用RSS 0.91。
 
3、 RSS的语法介绍
  一个RSS文件就是一段规范的XML数据,该文件一般以rss,xml或者rdf作为后缀。下面我们选择http://msdn.microsoft.com/visualc/rss.xml中的一部分作为例子简单说(略)
 
4、 RSS的联合(Syndication)和聚合(Aggregation)
  发布一个RSS文件(一般称为RSS Feed)后,这个RSS Feed中包含的信息就能直接被其他站点调用,而且由于这些数据都是标准的XML格式,所以也能在其他的终端和服务中使用,如PDA、手机、邮件列表等。而且一个网站联盟(比如专门讨论旅游的网站系列)也能通过互相调用彼此的RSS Feed,自动的显示网站联盟中其他站点上的最新信息,这就叫着RSS的联合。这种联合就导致一个站点的内容更新越及时、RSS Feed被调用的越多,该站点的知名度就会越高,从而形成一种良性循环。
  而所谓RSS聚合,就是通过软件工具的方法从网络上搜集各种RSS Feed并在一个界面中提供给读者进行阅读。这些软件可以是在线的WEB工具,如http://my.netscape.com ,http://my.userland.com , http://www.xmltree.com ,http://www.moreover.com ,http://www.oreillynet.com/meerkat 等,也可以是下载到客户端安装的工具
 
5、 RSS的未来发展
  随着越来越多的站点对RSS的支持,RSS已经成为目前最成功的XML应用。RSS搭建了信息迅速传播的一个技术平台,使得每个人都成为潜在的信息提供者。相信很快我们就会看到大量基于RSS的专业门户、聚合站点和更精确的搜索引擎。
 
参考文献:
1、 RSS 0.9 Specification http://www.purplepages.ie/RSS/netscape/rss0.90.html
2、 RSS 1.0 Specification http://web.resource.org/rss/1.0/spec
3、 RSS 2.0 Specification http://blogs.law.harvard.edu/tech/rss
 

        RSS is a format for syndicating news and the content of news-like sites, including major news sites like Wired, news-oriented community sites like Slashdot, and personal weblogs. But it's not just for news. Pretty much anything that can be broken down into discrete items can be syndicated via RSS: the "recent changes" page of a wiki, a changelog of CVS checkins, even the revision history of a book. Once information about each item is in RSS format, an RSS-aware program can check the feed for changes and react to the changes in an appropriate way.
 
        RSS-aware programs called news aggregators are popular in the weblogging community. Many weblogs make content available in RSS. A news aggregator can help you keep up with all your favorite weblogs by checking their RSS feeds and displaying new items from each of them.
 
A brief history
        But coders beware. The name "RSS" is an umbrella term for a format that spans several different versions of at least two different (but parallel) formats. The original RSS, version 0.90, was designed by Netscape as a format for building portals of headlines to mainstream news sites. It was deemed overly complex for its goals; a simpler version, 0.91, was proposed and subsequently dropped when Netscape lost interest in the portal-making business. But 0.91 was picked up by another vendor, UserLand Software, which intended to use it as the basis of its weblogging products and other web-based writing software.
        In the meantime, a third, non-commercial group split off and designed a new format based on what they perceived as the original guiding principles of RSS 0.90 (before it got simplified into 0.91). This format, which is based on RDF, is called RSS 1.0. But UserLand was not involved in designing this new format, and, as an advocate of simplifying 0.90, it was not happy when RSS 1.0 was announced. Instead of accepting RSS 1.0, UserLand continued to evolve the 0.9x branch, through versions 0.92, 0.93, 0.94, and finally 2.0.
 
What a mess.
 
So which one do I use?
That's 7 -- count 'em, 7! -- different formats, all called "RSS". As a coder of RSS-aware programs, you'll need to be liberal enough to handle all the variations. But as a content producer who wants to make your content available via syndication, which format should you choose?
RSS versions and recommendations Version Owner Pros Status Recommendation
0.90 Netscape   Obsoleted by 1.0 Don't use
0.91 UserLand Drop dead simple Officially obsoleted by 2.0, but still quite popular Use for basic syndication. Easy migration path to 2.0 if you need more flexibility
0.92, 0.93, 0.94 UserLand Allows richer metadata than 0.91 Obsoleted by 2.0 Use 2.0 instead
1.0 RSS-DEV Working Group RDF-based, extensibility via modules, not controlled by a single vendor Stable core, active module development Use for RDF-based applications or if you need advanced RDF-specific modules.
2.0 UserLand Extensibility via modules, easy migration path from 0.9x branch Stable core, active module development Use for general-purpose, metadata-rich syndication .
 
What does RSS look like?

Imagine you want to write a program that reads RSS feeds, so that you can publish headlines on your site, build your own portal or homegrown news aggregator, or whatever. What does an RSS feed look like? That depends on which version of RSS you're talking about. Here's a sample RSS 0.91 feed (adapted from XML.com's RSS feed):
<rss version="0.91">
  <channel>
    <title>XML.com</title>
    <link>http://www.xml.com/</link>
    <description>XML.com features a rich mix of information and services for the XML community.</description>
    <language>en-us</language>
    <item>
      <title>Normalizing XML, Part 2</title>
      <link>http://www.xml.com/pub/a/2002/12/04/normalizing.html</link>
      <description>In this second and final look at applying relational normalization techniques to W3C XML Schema data modeling, Will Provost discusses when not to normalize, the scope of uniqueness and the fourth and fifth normal forms.</description>
    </item>
    <item>
      <title>The .NET Schema Object Model</title>
      <link>http://www.xml.com/pub/a/2002/12/04/som.html</link>
      <description>Priya Lakshminarayanan describes in detail the use of the .NET Schema Object Model for programmatic manipulation of W3C XML Schemas.</description>
    </item>
    <item>
      <title>SVG's Past and Promising Future</title>
      <link>http://www.xml.com/pub/a/2002/12/04/svg.html</link>
      <description>In this month's SVG column, Antoine Quint looks back at SVG's journey through 2002 and looks forward to 2003.</description>
    </item>
  </channel>
</rss>
 
Simple, right? A feed comprises a channel, which has a title, link, description, and (optional) language, followed by a series of items, each of which have a title, link, and description.
Now look at the RSS 1.0 version of the same information:
 
<rdf:RDF
  xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="
http://purl.org/rss/1.0/"
  xmlns:dc="
http://purl.org/dc/elements/1.1/"
>
  <channel rdf:about="
http://www.xml.com/cs/xml/query/q/19">
    <title>XML.com</title>
    <link>http://www.xml.com/</link>
    <description>XML.com features a rich mix of information and services for the XML community.</description>
    <language>en-us</language>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="
http://www.xml.com/pub/a/2002/12/04/normalizing.html"/>
        <rdf:li rdf:resource="
http://www.xml.com/pub/a/2002/12/04/som.html"/>
        <rdf:li rdf:resource="
http://www.xml.com/pub/a/2002/12/04/svg.html"/>
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="
http://www.xml.com/pub/a/2002/12/04/normalizing.html">
    <title>Normalizing XML, Part 2</title>
    <link>http://www.xml.com/pub/a/2002/12/04/normalizing.html</link>
    <description>In this second and final look at applying relational normalization techniques to W3C XML Schema data modeling, Will Provost discusses when not to normalize, the scope of uniqueness and the fourth and fifth normal forms.</description>
    <dc:creator>Will Provost</dc:creator>
    <dc:date>2002-12-04</dc:date>   
  </item>
  <item rdf:about="
http://www.xml.com/pub/a/2002/12/04/som.html">
    <title>The .NET Schema Object Model</title>
    <link>http://www.xml.com/pub/a/2002/12/04/som.html</link>
    <description>Priya Lakshminarayanan describes in detail the use of the .NET Schema Object Model for programmatic manipulation of W3C XML Schemas.</description>
    <dc:creator>Priya Lakshminarayanan</dc:creator>
    <dc:date>2002-12-04</dc:date>   
  </item>
  <item rdf:about="
http://www.xml.com/pub/a/2002/12/04/svg.html">
    <title>SVG's Past and Promising Future</title>
    <link>http://www.xml.com/pub/a/2002/12/04/svg.html</link>
    <description>In this month's SVG column, Antoine Quint looks back at SVG's journey through 2002 and looks forward to 2003.</description>
    <dc:creator>Antoine Quint</dc:creator>
    <dc:date>2002-12-04</dc:date>   
  </item>
</rdf:RDF>
 
        Quite a bit more verbose. People familiar with RDF will recognize this as an XML serialization of an RDF document; the rest of the world will at least recognize that we're syndicating essentially the same information. In fact, we're including a bit more information: item-level authors and publishing dates, which RSS 0.91 does not support.
 
<environment xmlns:xlink="http://www.w3.org/1999/xlink"  xlink:type="extended">
        <!-- an artist is bound to his influences and history -->
        <artist    xlink:type="locator" xlink:role="artist"  xlink:href="modigliani.xml"/>
        <influence xlink:type="locator" xlink:label="inspiration" xlink:href="/blog/cezanne.xml"/>
        <influence xlink:type="locator" xlink:label="inspiration" xlink:href="/blog/lautrec.xml"/>
        <influence xlink:type="locator" xlink:label="inspiration" xlink:href="rouault.xml"/>
        <history   xlink:type="locator" xlink:label="period" xlink:href="paris.xml"/>
        <history   xlink:type="locator" xlink:label="period" xlink:href="/blog/kisling.xml"/>
        <bind xlink:type="arc" xlink:from="artist"  xlink:to="inspiration"/>
        <bind xlink:type="arc" xlink:from="artist"  xlink:to="period"/>
</environment>
阅读全文 | 回复(0) | 引用通告 | 编辑 | By: 皮皮爸爸
  • 标签:XML 
  • 发表评论:

      大名:
      密码: (游客无须输入密码)
      主页:
      标题:
      80
    Powered by Oblog.