W3C验证器说我的标记无效

时间:2016-10-25 15:19:31

标签: xml validation rss

我一直在通过W3C验证器进行一些测试:

https://validator.w3.org/feed/check.cgi

一切顺利,直到我决定使用“enclosure”元素添加图像。

验证人声明图片网址无效,即使该网址是可点击的。

我阅读了一些帖子并意识到许多人在运行https时遇到了问题,我就是这样。为了证明/反驳这是错误,我将所有https:改为http:但错误仍然存​​在。

最终,我将图像域从“.direct”更改为“.com”并进行了验证。这到底是怎么回事?当然,并非所有Feed验证程序都无法解析过去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> 

1 个答案:

答案 0 :(得分:0)

  

任何人都对如何解决这个问题有任何想法?

没有什么可以解决的。

验证器是帮助您进行质量检查的工具。

有时工具有bug。在这种情况下,URL验证代码似乎尚未使用新的TLD规则进行更新。

report the bug然后忽略错误消息,直到它被修复或download the source code并自行修复错误(理想情况是向社区提供补丁)。