RSS enclosure Element

2018-03-09 15:23 更新

RSS <enclosure> 元素

RSS <enclosure> 元素是 <item> 元素的子元素,本節(jié)介紹了該元素的使用。


RSS 參考手冊(cè) 完整 RSS 參考手冊(cè)

定義和用法

<enclosure> 元素允許把媒體文件包含在項(xiàng)目中。


屬性

屬性 描述
length 必需。定義媒體文件的長(zhǎng)度(以字節(jié)計(jì))。
type 必需。定義媒體文件的類型。
url 必需。定義指向該媒體文件的 URL。


實(shí)例

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

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

  </item>
</channel>

</rss>

嘗試一下 ?

RSS 參考手冊(cè) 完整 RSS 參考手冊(cè)
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)