Search code examples
xhtmldoctypew3c-validationrdfa

Website W3C validator shows "Mismatch between Public and System identifiers in the DOCTYPE declaration", what to do?


I'm trying to validate my website Hybrid.cz in the W3C validator. Unfortunately, it keeps showing the same errors because of the "Mismatch between Public and System identifiers in the DOCTYPE declaration". It says:

This document uses an inconsistent DOCTYPE declaration. The System Identifier w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd declares the XHTML 1.0 Transitional document type, but the associated Public Identifier -//W3C//DTD XHTML+RDFa 1.0 Transitional//EN does not match this document type.

The recommended Public Identifier for w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd is -//W3C//DTD XHTML 1.0 Transitional//EN.

My DOCTYPE is:

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>

I'm not really experienced in DOCTYPES. But I want to be able to use RDFa attributes within the site. What should I do?


Solution

  • You find a DTD which supports the mixture of XML languages you want to use, then you look up the correct Doctype for it.

    Searching turns up the XHTML+RDFa 1.1 - Second Edition specification.

    This shows the Doctype to be:

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