罗马 RSS - 禁用罗马 RSS 中的验证

发布于 2024-08-24 03:39:42 字数 152 浏览 8 评论 0原文

在我的应用程序中,ROME api 尝试根据 W3C 中的 DTD 验证提要,但一段时间后它会失败,因为 W3C 阻止了该 IP。

有没有办法可以在 ROME 中禁用 XML 提要验证?

RSS XML 验证不是必需的,因为我们从一家信誉良好的公司获取提要

In my application ROME api tries to validate the feed against and DTD in W3C and after some time it fails since W3C blocks that IP.

Is there a way that I can disable XML feed validation in ROME?

RSS XML validation is not neccessary since we get the feed from a well reputed company

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

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

发布评论

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

评论(1

雨轻弹 2024-08-31 03:39:42

你可以试试这个吗?

// create a Document from inputstream is
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(is);

// fetch the feed
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(doc);

这个想法是首先将 XML 解析为文档,然后将该文档传递给 SyndFeedInput。使用 DocumentBuilder 进行解析不会根据 DTD 进行验证。

can you try this?

// create a Document from inputstream is
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(is);

// fetch the feed
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(doc);

the idea is to first parse the XML into a Document and then pass that document to the SyndFeedInput. parsing with the DocumentBuilder doesn't validate against a DTD.

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