dd

RSS <enclosure> 元素


定义和用法

<enclosure> 元素允许把媒体文件包含在项目中。

属性

属性 描述
length 必需。定义媒体文件的长度(以字节计)。
type 必需。定义媒体文件的类型。
url 必需。定义指向该媒体文件的 URL。

实例

<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">

<channel>
  <title>W3CSchool Home Page</title>
  <link>http://www.shouce.ren</link>
  <description>Free web building tutorials</description>
  <item>
    <title>RSS Tutorial</title>
    <link>http://www.shouce.ren/rss</link>
    <description>New RSS tutorial on W3CSchool</description>
    <enclosure url="http://www.shouce.ren/media/3d.wmv"
    length="78645" type="video/wmv" />
  </item>
</channel>

</rss>