我收到了几个关于使用drupal的网站的验证错误,来自页面的这一部分:
<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>以下验证错误:
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或其他站点时遇到过这种情况吗?
发布于 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"。
https://stackoverflow.com/questions/24765675
复制相似问题