I'm in the process of learning XHTML. If my understanding is correct, XHTML follows strict syntax. So I created this markup:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>XHTML page</title>
<!-- </head> -->
<body>
This is the body
</body>
</html>
I've commented the ending head tag to check the strictness of XHTML. When I saved this file with .xhtml extension it showed an error. But when I saved it with .html extension browser was very forgiving and rendered the markup irrespective of the missing head tag.
So my doubt is, is it the extension(.xhtml) what makes a file actually xhtml and gives it strict syntax behavior? Shouldn't it be the DOCTYPE that determine whether its an xhtml or not?
From what I read somewhere, in HTTP, file extension doesn't really matter and its the header type that matters.