Validator.w3.org doesn't understand my HTML 4.01+RDFa

I have following code in the page head:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/html401-rdfa-1.dtd">
<html xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8">

If i try to validate this page with Validator.w3.org and do it with automatic doctype detecting, i get 174 errors and the doctype is shown as -//W3C//DTD HTML 4.01+RDFa 1.0//EN. Here is the validation result.

Then if setting the doctype manually to HTML 4.01+RDFa 1.1 and revalidate the page, the doctype is shown as HTML 4.01 Transitional, there are 2 errors and 2 warnings: Unable to Determine Parse Mode and DOCTYPE Override in effect! The validator seems not to understand my doctype and writes:

The detected DOCTYPE Declaration >!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01+RDFa 1.0//EN" "hxxp://www.w3.org/MarkUp/DTD/html401-rdfa-1.dtd"< has been suppressed and the DOCTYPE for "HTML 4.01 + RDFa 1.1" inserted instead...

If setting the validator up to show the source code, so i see, that the validator has a little bit another code, as the the page has. The validator changes the first line of the code to

<!DOCTYPE ><!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/html401-rdfa-1.dtd"> -->

and comments my right doctype out...`

Would somebody point me to the right doctype (or right syntax/workaround)?


Is there any reason why you are not using a more mainstream RDFa doctype such as:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">

or even the more simple HTML5 doctype:

<!DOCTYPE html>

链接地址: http://www.djcxy.com/p/89034.html

上一篇: SVG中的XPointers

下一篇: Validator.w3.org不理解我的HTML 4.01 + RDFa