-4

What is the actual role of DOCTYPE included in xhtml ?

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
Raptor
  • 53,206
  • 45
  • 230
  • 366

1 Answers1

1

I'm assuming you refer to how the browsers handle XHTML documents with or without a DOCTYPE declaration, because you can't see the difference on the screen. No Quirks mode, no Almost-Standards mode, only standards compliance, no matter what DOCTYPE you use, no matter if you use a DOCTYPE at all.

Yes, XHTML documents (but only if they're real XHTML documents, with a proper XML MIME type or an .xhtml file extension) are always rendered in standards mode. So that's not where the differences lie.

The only actual difference I found so far is that when you use entity references such as &eacute;, you will need an XHTML DOCTYPE, including the DTD. Without it (or with the abbreviated HTML5 one) the document wouldn't find the list of entity names, and it would only know about the five XML entities - &quot;, &apos;, &amp;, &lt; and &gt;.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150