问题描述
我正在尝试通过 W3C 验证器传递页面.站点地图上的验证失败,我将其包括在内:
I'm trying to pass a page through the W3C Validator. The validation fails on the sitemap, which I'm including like this:
<link rel="sitemap" type="application/xml" title="Sitemap" href="../sitemap.xml" />
我得到的错误是:
元素链接上的属性 rel 的价值站点地图错误:不是绝对的 IRI.字符串站点地图不是注册关键字或绝对 URL.
我一直在努力修复它,但我尝试的任何东西似乎都不起作用,而且这是 Google 和 Html5 Boilerplate 推荐的布局.
I have been trying forever to fix it, but nothing I'm trying seems to work plus this is the recommended layout by Google and Html5 Boilerplate.
我的语法有什么问题吗?看起来是对的,但为什么不通过?
Is there anything wrong with my syntax? Seems correct, but why is it not passing?
推荐答案
简短的回答是你不能.
HTML 5 定义了您可以在 rel
中使用的值,而 sitemap
不是验证器识别的值之一.
HTML 5 defines the values that you are allowed to use in rel
and sitemap
is not one of the ones recognised by the validator.
错误消息确实说您可以在 wiki 上注册新的链接类型 ,但站点地图已经存在,所以您只需要等待验证器开发人员更新验证器以反映 wiki 的新状态(假设没有人删除该条目).
The error message does say that you can register a new link type on a wiki, but sitemap is already there so you just have to wait for the validator developers to update the validator to reflect the new state of the wiki (assuming nobody deletes the entry).
(这里的基本问题是,让规范使用 wiki 页面作为规范资源是很疯狂的,HTML 5 仍然是草案,并且 HTML 5 验证器仍然被认为是实验性的).
(The basic problems here are that having the specification use a wiki page as a normative resource is nuts, that HTML 5 is still a draft, and that the HTML 5 validator is still considered experimental).
这篇关于如何让页面头部的站点地图链接通过W3C验证器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!