首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >W3C验证错误

W3C验证错误
EN

Stack Overflow用户
提问于 2014-07-16 02:36:49
回答 1查看 3.1K关注 0票数 2

我收到了几个关于使用drupal的网站的验证错误,来自页面的这一部分:

代码语言:javascript
复制
<html lang="en" dir="ltr"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:og="http://ogp.me/ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:sioc="http://rdfs.org/sioc/ns#"
xmlns:sioct="http://rdfs.org/sioc/types#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<head>

以下验证错误:

代码语言:javascript
复制
Line 11, Column 48: Attribute xmlns:content not allowed here.
Line 11, Column 48: Attribute xmlns:dc not allowed here
Line 11, Column 48: Attribute xmlns:foaf not allowed here.
Line 11, Column 48: Attribute xmlns:og not allowed here.
Line 11, Column 48: Attribute xmlns:rdfs not allowed here.

等等……

有人在使用drupal或其他站点时遇到过这种情况吗?

EN

回答 1

Stack Overflow用户

发布于 2014-07-16 03:41:12

从症状上看,您可能是在使用<!DOCTYPE html>验证HTML5。W3C验证器根据xmlns:content等属性无效的HTML序列化规则(HTML语法)进行验证。没有名称空间的概念,所以属性名称中的任何:只是另一个没有特殊含义的字符,这样的名称还没有定义。

使用http://validator.nu/,您可以在“Preset”下拉列表中选择HTML5的XML序列化,即XHTML5。然后,您需要遵循所有的XML规则以及HTML5规则,并且需要在<html>标记中包含属性xmlns="http://www.w3.org/1999/xhtml"

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24765675

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档