帮助将 RDF 放入网页 (jsp)
当我阅读 Common-Tags 的文档时,我认为将其放入 jsp 中会很容易,因为示例是剪切和粘贴的。
<body xmlns:ctag="http://commontag.org/ns#" rel="ctag:tagged">
<span typeof="ctag:Tag"
rel="ctag:means"
resource="http://rdf.freebase.com/ns/en.u2"
property="ctag:label" content="U2"/>
</span>
</body>
我们在开发工作中使用 Eclipse 是一件好事。它告诉我们我们的标记有问题。它用黄色返回强调了通用标签标记:
Undefined attribute name
我在这里错过了什么?或者这完全可以吗?
When I read the documentation on Common-Tags, I thought it would be easy to put this in a jsp because the examples were cut and paste
<body xmlns:ctag="http://commontag.org/ns#" rel="ctag:tagged">
<span typeof="ctag:Tag"
rel="ctag:means"
resource="http://rdf.freebase.com/ns/en.u2"
property="ctag:label" content="U2"/>
</span>
</body>
It's a good thing that we're using Eclipse in our dev work. It's telling us that something is wrong with our markup. It's underlining the common-tags markup with yellow returning:
Undefined attribute name
What am I missing here? or is this completely okay?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
typeof、resource 和 property 属性是 XHTML 的扩展,它们是 RDFa 规范的一部分,这就是 Eclipse 不知道它们的原因。
由于 RDFa+XHTML 现在已成为 W3C 推荐标准,因此按原样使用绝对没问题。
http://www.w3.org/TR/rdfa-syntax/# rdfa-属性
The typeof, resource and property attributes are extensions to XHTML which are part of the RDFa specification which is why Eclipse doesn't know about them.
Since RDFa+XHTML is now a W3C recommendation this is absolutely fine to use as is.
http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes
我假设您没有发送带有 XML MIME 类型的页面,因为该代码段的格式不正确。使用 text/html MIME 类型时不允许使用 RDFa。如需替代方案,请查看“microdata”。
I assume you're not sending your pages with an XML MIME type, because that snippet isn't well-formed. Using RDFa isn't allowed when using a text/html MIME type. For an alternative, have a look at "microdata".