<title>:这是项的名称,在标准应用中被转换成 HTML 中的标题。 <link>:这是该项的 URL。title 通常作为一个链接,指向包含在 <link> 元素中的 URL。 <description>:通常作为 link 中所指向的 URL 的摘要或者补充。 所有的元素都是可选的,但是一个项至少要么 包含一个 <title>,要么包含一个 <description>。
项还有其他一些可选的元素:
<author>:作者的 e-mail 地址。 <category>:支持有组织的记录。 <comments>:关于项的注释页的 URL。 <enclosure>:支持和该项有关的媒体对象。 <guid>:唯一与该项联系在一起的永久性链接。 <pubDate>:该项是什么时候发布的。 <source>:该项来自哪个 RSS 频道,当把项聚合在一起时非常有用。 清单 1 是一个 RSS 2.0 文件的例子。注重,频道包含在 <rss version="2.0"> 中。这是一个非常基本的例子,说明了项和图像如何包含在频道中。所示的元素都是最常用的频道子元素。
<?xml version="1.0"?><rss version="2.0"> <channel> <title>The channel's name goes here</title> <link>http://www.urlofthechannel.com/</link> <description>This channel is an example channel for an article. </description> <language>en-us</language> <image> <title>The image title goes here</title> <url>http://www.urlofthechannel.com/images/logo.gif</url> <link>http://www.urlofthechannel.com/</link> </image> <item> <title>The Future of content</title> <link>http://www.itworld.com/nl/ecom_in_act/11122003/</link> <description> The issue of people distributing and reusing digital media is a problem for many businesses. It may also be a hidden opportunity. Just as open source licensing has opened up new possibilities in the world of technology, it promises to do the same in the area of creative content.</description> </item> <item> <title>Online Music Services - Better than free?</title> <link>http://www.itworld.com/nl/ecom_in_act/08202003/</link> <description>More people than ever are downloading music from the Internet. Many use person-to-person file sharing programs like Kazaa to share and download music in MP3 format, paying nothing. This has made it difficult for companies to setup online music businesses. How can companies compete against free?</description> </item> </channel></rss>
评论加载中…
![]() |