【发布时间】:2016-10-25 15:19:30
【问题描述】:
我一直在通过 W3C 验证器运行一些测试:
https://validator.w3.org/feed/check.cgi
一切都很顺利,直到我决定使用“enclosure”元素添加图像。
验证器指出图像 url 无效,即使它是可点击的。
我阅读了一些帖子,发现很多人在运行 https 时遇到了问题,我就是这样。为了证明/反驳这是我将所有 https: 更改为 http: 的错误,但错误仍然存在。
最终,我将图像域从“.direct”更改为“.com”,并通过了验证。这到底是怎么回事?当然,并非所有提要验证器都无法解析过去 5 年推出的任何新域名。
有人知道如何解决这个问题吗?
<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel xmlns:atom="http://www.w3.org/2005/Atom"><title>This is a feed title</title><link>http://example.com/</link><description>This is a feed description</description><copyright>http://example.com 2016</copyright><lastBuildDate>Tue, 25 Oct 2016 16:08:07 +0100</lastBuildDate><atom:link href="http://example.com/feeds/myfeed" rel="self" type="application/rss+xml" /><item><guid isPermaLink="true">http://example.com/</guid><link>http://example.com/</link><title>This is an item title</title><description>This is an item description</description><pubDate>Tue, 25 Oct 2016 00:00:00 Z</pubDate><enclosure type="image/jpeg" url="http://example.com/my-pic.jpg" length="2848" /></item></channel></rss>
【问题讨论】:
-
值得注意的是,该页面的常见问题解答指向a Google Code archive showing the last commit in 2010。所以是的,这个特定的验证器完全有可能拒绝过去 5 年内推出的任何域。
标签: xml validation rss