有没有一种干净的方法来确定 RSS 版本?

发布于 2024-08-26 03:39:47 字数 139 浏览 3 评论 0原文

是否可以通过某种方式确定提要类型和版本,以便确保您拥有正确的版本。可以说是最低级别。命名空间是一种显而易见的方法,但很多提要中并不存在。

有什么想法吗?

(我正在尝试混搭各种 RSS 源)。

预先感谢您的任何帮助!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

雨巷深深 2024-09-02 03:39:47

考虑到变体的数量、混合命名空间的人数(通常是在没有命名空间的 RSS 版本中使用完整内容元素)以及无效提要的数量。

不。您最好只获得一个良好的提要解析库,让它抽象出所有版本问题,并从您检索到的数据构建一个干净的 Atom 提要。

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.

捂风挽笑 2024-09-02 03:39:47

我不知道有什么干净的方法。查看此问题了解多种方法。

Zend_Feed_Reader 在我看来很有趣。也许可以尝试用它来获取提要的版本。

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.

温折酒 2024-09-02 03:39:47

看看罗马 Project ROME feed 解析库
(来源:rollerweblogger.org

它能够解析各种 RSS 和 ATOM 联合提要和版本,并发出您想要的任何联合提要格式/版本。

ROME是一套开源Java
用于解析、生成和
发布 RSS 和 Atom 提要。这
核心 ROME 库仅依赖于
JDOM XML解析器并支持解析,
生成并转换所有的
流行的 RSS 和 Atom 格式包括
RSS 0.90,RSS 0.91 网景,RSS 0.91
用户区,RSS 0.92,RSS 0.93,RSS
0.94、RSS 1.0、RSS 2.0、Atom 0.3 和 Atom 1.0。您可以解析为 RSS
对象模型、Atom 对象模型或
一个抽象的 SyndFeed 模型可以
对任一格式系列进行建模。

Take a look at ROME Project ROME feed parsing library
(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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文