XHTML vs HTML
XHTML is a reformulation of HTML that tightens up its rules. Although XHTML looks quite similar to HTML (and is identical in many cases), it doesn’t tolerate the same looseness as HTML. For example, HTML tolerates missing information and many minor mistakes. Unfortunately, this creates a problem with web browser support, because different browsers may react differently to these minor glitches. XHTML doesn’t allow the same sloppi-ness, so the final result is more consistent in different browsers.
The X at the beginning of XHTML stands for XML, because XHTML is technically a flavor of XML and plays by its rules. (XML is an all-purpose standard for storing information in a flexible way that’s not tied to any particular application, operating system, or programming environment. Although you may not know much about XML right now, you’ll take a detailed look at it in Chapter 19.)
There is a deeply buried configuration setting that allows you to change the way ASP.NET works so that it uses HTML instead of XHTML. But developers rarely use this option unless they have issues with old web documents (for example, they want to take legacy HTML pages and transform them to ASP.NET web forms in the fastest way possible). If you’re developing a new website, there’s no reason not to use XHTML. (And avoiding XHTML can cause problems if you try to use ASP.NET’s new AJAX toolkit, which is described in Chapter 25.) But if you really must know how to get back to the past, search the Visual Studio Help for the xhtmlConformance configuration setting
Recent Comments