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

How Does This Relate to XML

The great thing about XML (and also a not so great thing, which I will explain in a moment) is that XML was design so you can create your own custom language, with the tags (elements) and attributes you need.

To create your own lanugage in XML, you create a DTD. In your DTD, you define each and every tag and any attributes you want it to have. Then, any application designed to read XML will use your DTD to know which tags are allowed (and not allowed) and how they relate to each other.

In HTML, all the tags and attributes are already created, ready to go, and there are already a lot of applications with the built-in ability to read and understand HTML, which is a big advantage of using HTML over using XML. Creating an XML language can be easy or it can consume and waste a lot of time. In fact, I use HTML a lot instead of XML. Why create an XML language with tags like <para> and <image> when HTML already has elements for describing that type of content? There is no reason you cannot use HTML as XML, which is where XHTML comes in.



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