2014-07-15 204 views
1

我正在使用Drupal的关于网站的几个验证错误,从页面的这一部分来:W3C验证错误

<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或任何其他网站体验过吗?

+0

您应该指定要验证的HTML版本。 –

+0

HTML5,但它看起来像该网页正在使用一些XML – mako

回答

1

从症状看来,您似乎正在验证对HTML5,可能使用<!DOCTYPE html>。 W3C验证器根据HTML序列化规则(HTML语法)进行验证,其中xmlns:content等属性无效。没有名称空间的概念,因此属性名称中的任何:只是另一个没有特殊含义的字符,并且这些名称尚未定义。

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