如何使用RDFa"vocab"在XHTML中 [英] How to use RDFa "vocab" within XHTML
问题描述
我正在尝试完成此(简单)网页以进行分配,并且需要通过 http://validateator.w3.org/
它还需要使用RDFa.但是,无论我做什么,RDFa vocab
都不会被验证程序传递.
I'm trying to get this (simple) webpage done for my assignment and it needs to pass through http://validator.w3.org/
It also needs to use RDFa. However no matter what I do, the RDFa vocab
never gets passed by the validator.
这就是我得到的:
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'>
<body vocab="http://xmlns.com/foaf/0.1/">
我在做什么错了?
推荐答案
vocab
属性在RDFa 1.1中定义,但是对于当前的DOCTYPE,您正在使用RDFa 1.0.
The vocab
attribute is defined in RDFa 1.1, but with your current DOCTYPE, you are using RDFa 1.0.
您的选择:
-
继续使用XHTML 1.1和RDFa 1.0,并使用
xmlns:…
属性而不是无效的vocab
属性:
Keep using XHTML 1.1 and RDFa 1.0, and use the
xmlns:…
attribute(s) instead of the invalidvocab
attribute:
<body xmlns:foaf="http://xmlns.com/foaf/0.1/">
(然后您必须使用前缀foaf:
.)
(Then you have to use the prefix foaf:
.)
继续使用XHTML 1.1,但切换到支持RDFa 1.1的DOCTYPE:
Keep using XHTML 1.1, but switch to a DOCTYPE that supports RDFa 1.1:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
切换到默认支持RDFa 1.1的XHTML5:
Switch to XHTML5, which supports RDFa 1.1 by default:
<!DOCTYPE html>
这篇关于如何使用RDFa"vocab"在XHTML中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!