惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

笔墨迹

暂无文章

RSS 1.0、RSS 2.0 和 ATOM 三种标准格式的示例及其主要特点:
xiangmingya · 2025-04-06 · via 笔墨迹

1. RSS 1.0 (基于 RDF)

<?xml version="1.0"?>
<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/rss/1.0/">
  <channel rdf:about="http://example.com/rss">
    <title>示例频道</title>
    <link>http://example.com</link>
    <description>这是一个RSS 1.0示例</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://example.com/post1" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="http://example.com/post1">
    <title>文章标题</title>
    <link>http://example.com/post1</link>
    <description>文章内容摘要</description>
  </item>
</rdf:RDF>

特点

  • 基于 RDF(资源描述框架),语义化更强。
  • 使用 rdf:RDF 根元素和命名空间。
  • 频道和条目通过 rdf:about 关联。

2. RSS 2.0 (更简单的主流格式)

<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>示例频道</title>
    <link>http://example.com</link>
    <description>这是一个RSS 2.0示例</description>
    <item>
      <title>文章标题</title>
      <link>http://example.com/post1</link>
      <description>文章内容摘要</description>
      <pubDate>Mon, 01 Jan 2024 12:00:00 GMT</pubDate>
      <guid isPermaLink="false">12345</guid>
    </item>
  </channel>
</rss>

特点

  • 更简洁,无 RDF 依赖。
  • 根元素为 <rss version="2.0">
  • 支持扩展元素如 pubDate(发布日期)、guid(唯一标识符)。
  • 广泛兼容(如播客订阅)。

3. ATOM (更现代的格式)

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>示例频道</title>
  <link href="http://example.com"/>
  <updated>2024-01-01T12:00:00Z</updated>
  <author>
    <name>作者名</name>
  </author>
  <id>urn:uuid:12345</id>
  <entry>
    <title>文章标题</title>
    <link href="http://example.com/post1"/>
    <id>urn:uuid:67890</id>
    <updated>2024-01-01T12:00:00Z</updated>
    <summary>文章内容摘要</summary>
    <content type="html">这里是完整HTML内容...</content>
  </entry>
</feed>

特点

  • 使用严格的 XML 命名空间 (xmlns="http://www.w3.org/2005/Atom")。
  • 强制要求 idupdated 等字段,规范性更强。
  • 支持更丰富的内容类型(如 content type="html")。
  • 时间格式遵循 ISO 8601(如 2024-01-01T12:00:00Z)。

对比总结

特性RSS 1.0RSS 2.0ATOM
基础标准RDFXMLXML (W3C 标准)
根元素<rdf:RDF><rss version="2.0"><feed>
时间格式无严格要求RFC 822 (如 pubDate)ISO 8601 (如 updated)
扩展性依赖 RDF通过命名空间扩展原生支持丰富内容类型
典型用途语义网场景博客、播客现代应用(如 GitHub)

本文由 xiangmingya 创作,采用 知识共享署名4.0 国际许可协议进行许可。
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。