Sp 55

From Htmlpedia
Jump to: navigation, search

OpenSP: "DOCTYPE" declaration not allowed in instance

Cause:

You have defined a doctype past the XML contents of the document (after the first real element's start tag).

This is usually caused by an automatic concatenation of pages, or in Google caches (and similar) that mercilessly prepend a header to the cached page.

Example:

Bad<html>

<head>
<title>Hello world</title>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
</head>
<body>
</body>

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

<html>
<head>
<title>Hello world</title>
</head>
<body>
</body>

</html>