开发者

Is there a clean way to determine RSS version?

Is it possible to determine the feed type and version in a way so that you can make sure that you have the correct version. At 开发者_如何学编程the lowest level so to speak. Namespaces is an obvious approach, but its not present for a lot of feeds.

Any thoughts?

(I'm trying to mashup varioius RSS Feeds).

Thanks in advance for any help!


Given the number of variations, the number of people mixing namespaces (usually to use a full content element in a version of RSS that doesn't have one), and the number of invalid feeds.

No. You'd be better off just getting a good feed parsing library and letting it abstract away all the version issues and building a clean Atom feed from the data you retrieve from it.


I don't know of a clean way. Check out this question for a number of approaches.

Zend_Feed_Reader looks interesting IMO. Maybe it's possible to try and get the feed's version with that.


Take a look at ROME

Is there a clean way to determine RSS version?


(source: rollerweblogger.org)
.

It is able to parse a variety of RSS and ATOM syndication feeds and versions and emit whatever syndication feed format/version you want.

ROME is an set of open source Java tools for parsing, generating and publishing RSS and Atom feeds. The core ROME library depends only on the JDOM XML parser and supports parsing, generating and converting all of the popular RSS and Atom formats including RSS 0.90, RSS 0.91 Netscape, RSS 0.91 Userland, RSS 0.92, RSS 0.93, RSS 0.94, RSS 1.0, RSS 2.0, Atom 0.3, and Atom 1.0. You can parse to an RSS object model, an Atom object model or an abstract SyndFeed model that can model either family of formats.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜