2009-03-19

RSS Extending (RSS 擴充)

RSS 2.0 是可擴充且相容於 RSS 1.0 的
擴充的方法很簡單,只要不是 RSS 2.0 規範的標準 tag (XML Element)
都要用namespace來限定它(qulified) 這樣就可以進行RSS的擴充了~
這類在其它 namespace定義的RSS擴充用tag,在RSS世界裡 叫叫 RSS Module
因為 RSS 2.0定義的tag,都是 unqualified 的 (在XML Schema內: elementFormDefault="unqualified"),且 RSS2.0 的 tag name 為 RSS1.0 的superset
所以 RSS2.0 的reader 也可以吃 RSS1.0的feed(相容)

以下是 OpenSearch RSS2.0 Module的一個擴充實例:
--
備註一下: http://www.rssboard.org/rss-specification

Extending RSS *

RSS originated in 1999, and has strived to be a simple, easy to understand format, with relatively modest goals. After it became a popular format, developers wanted to extend it using modules defined in namespaces, asspecified by the W3C.

RSS 2.0 adds that capability, following a simple rule. A RSS feed may contain elements and attributes not described on this page, only if those elements and attributes are defined in a namespace.

The elements defined in this document are not themselves members of a namespace, so that RSS 2.0 can remain compatible with previous versions in the following sense -- a version 0.91 or 0.92 file is also a valid 2.0 file. If the elements of RSS 2.0 were in a namespace, this constraint would break, a version 0.9x file would not be a valid 2.0

沒有留言: