帮助将 RDF 放入网页 (jsp)

发布于 2024-08-07 17:01:03 字数 490 浏览 2 评论 0原文

当我阅读 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独孤求败 2024-08-14 17:01:03

typeofresourceproperty 属性是 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

今天小雨转甜 2024-08-14 17:01:03

我假设您没有发送带有 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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文