【问题标题】:W3C Validators says my markup is invalidW3C 验证器说我的标记无效
【发布时间】: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> 

【问题讨论】:

标签: xml validation rss


【解决方案1】:

有人知道如何解决这个问题吗?

没有什么可以绕过的。

验证器是帮助您进行 QA 的工具。

有时工具有错误。在这种情况下,URL 验证代码似乎没有根据 TLD 的新规则进行更新。

report the bug 然后忽略错误消息直到它得到修复或download the source code 并自己修复错误(最好向社区提供补丁)。

【讨论】:

    猜你喜欢
    • 2014-11-17
    • 1970-01-01
    • 1970-01-01
    • 2018-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-30
    • 1970-01-01
    相关资源
    最近更新 更多