DHTMLdev.com — Dedicated to quality Web development articles and tutorials
The Lowdown on HTML DTDs and DOCTYPEs PDF Print E-mail
Saturday, 25 March 2006
Article Index
The Lowdown on HTML DTDs and DOCTYPEs
An Example DTD
How Does This Relate to XML
The XHTML DTD: a Hybrid and XML and HTML
Taking Advantage of DOCTYPE
Conclusion: Additional Reading

The XHTML DTD: a Hybrid and XML and HTML

XML is a little different from traditional HTML in that is much more strict. In HTML, you can leave certain tags out and use a document structure that is inconsistent, for example, you can use an <li> tag without a closing </li> element, which can make programmatically reading (parsing) the document code a painful process for anyone writing custom programs.

XHTML, however, follows all the rigid syntax rules of XML but it uses no custom elements: all elements and attributes come from HTML. So any application, like a Web browser, that can read HTML can read XHTML. And any application design to read XML can also read XHTML. You get the best of both worlds. And it's all possible because of the XHTML DTD, which is really an XML DTD that defines all its elements based on the HTML DTD.



Last Updated ( Sunday, 26 March 2006 )
 
< Prev   Next >