0

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)?

Jamiu S.
  • 5,257
  • 5
  • 12
  • 34
Evgeniy
  • 2,337
  • 2
  • 28
  • 68

1 Answers1

0

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>

scor
  • 940
  • 5
  • 5
  • I deleted any doctype from my page and then tested one by one all doctypes available at Validator.w3.org. And so i finded, that with HTML 4.01 + RDFa 1.1 i got minimum validation errors.BTW, i tested both of your suggestions: with first i get more then 300 errors, with html5 i get 30 errors... – Evgeniy May 19 '13 at 09:29