WEB开发
  当前位置:首页 > 技术支持 > WEB开发
ATOM和RSS的区别
发布时间:2017-08-11 浏览:519次
  
    简单来说:ATOM是RSS2.0的改进方案,因为RSS2.0的标准已经冻结,所以才出了ATOM。主要改进是ATOM可以通过标签识别一个内容是否是全文输出而RSS2.0不可以。同时,ATOM不仅能够判断出内容是否是全文输出,在终端软件使用该FEED时,还可以从中得到那一部分是“摘要”那一部分是“全文”方便进行区别显示。

Element Comparison Table

Atom 1.0 defines 21 elements; RSS 2.0, 30. Most of the RSS 2.0 elements missing in Atom 1.0 are either those that were never widely implemented in practice, or the capabilities are provided in other ways.

RSS 2.0 Atom 1.0 Comments
rss - Vestigial in RSS
channel feed
title title
link link Atom defines an extensible family of rel values
description subtitle
language - Atom uses standard xml:lang attribute
copyright rights
webMaster -
managingEditor author or contributor
pubDate published (in entry) Atom has no feed-level equivalent
lastBuildDate (in channel) updated RSS has no item-level equivalent
category category
generator generator
docs -
cloud -
ttl - <ttl> is problematic, prefer HTTP 1.1 cache control
image logo Atom recommends 2:1 aspect ratio
- icon As in favicon.ico
rating -
textInput -
skipHours -
skipDays -
item entry
author author
- contributor
description summary and/or content depending on whether full content is provided
comments -
enclosure - rel="enclosure" on <link> in Atom
guid id
source - rel="via" on <link> in Atom
- source Container for feed-level metadata to support aggregation

Sample RSS and Atom Feeds

RSS 2.0

<?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>Example Feed</title> <description>Insert witty or insightful remark here</description> <link>http://example.org/</link> <lastBuildDate>Sat, 13 Dec 2003 18:30:02 GMT</lastBuildDate> <managingEditor>johndoe@example.com (John Doe)</managingEditor> <item> <title>Atom-Powered Robots Run Amok</title> <link>http://example.org/2003/12/13/atom03</link> <guid isPermaLink="false">urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</guid> <pubDate>Sat, 13 Dec 2003 18:30:02 GMT</pubDate> <description>Some text.</description> </item> </channel> </rss>

Atom 1.0

<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>Example Feed</title> <subtitle>Insert witty or insightful remark here</subtitle> <link href="http://example.org/"/> <updated>2003-12-13T18:30:02Z</updated> <author> <name>John Doe</name> <email>johndoe@example.com</email> </author> <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> <entry> <title>Atom-Powered Robots Run Amok</title> <link href="http://example.org/2003/12/13/atom03"/> <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> <updated>2003-12-13T18:30:02Z</updated> <summary>Some text.</summary> </entry> </feed>
 
 
    
 
 
版权所有 © 2005-2024 安徽省艾佳信息技术有限公司 皖ICP备06002923号  皖公网安备 34019202000659号
地址:安徽省合肥市蜀山区望江西路69号西湖国际广场 电话:0551-64935878 邮箱:admin@ajsoft.cn