schema.org's/Google Rich Snippet微格式是否违反HTML规则?


Is schema.org's/Google Rich Snippet microformatting breaking HTML rules?

根据schema.org,这是你应该如何标记你的html,以利用"丰富的片段"元数据,将被搜索引擎吞噬:

<div itemscope itemtype="http://schema.org/Event">

itemscope本身无效。它是布尔值,而不是像itemscope="true"

那样的属性

我正在使用PHPTAL,它拒绝处理我的页面一旦它运行到这个属性。其他验证器也会阻塞。

那么schema.org的规范是完全错误的吗?

这是一个布尔属性,在HTML5中是完全可以接受的。

我希望你的解析器是旧的。W3C验证服务对schema.org的格式没有问题。


新增链接:http://www.w3.org/TR/html5/common-microsyntaxes.html#boolean-attribute


为后人更新一下,答案是完全限定布尔属性。这意味着使用像itemscope="itemscope"

这样的语法