Why XHTML?

Submitted by Eus
on December 16, 2008 - 4:23am

Previously, I wondered why the need of XHTML specification by W3C. Now after I was cluttering my hands with ECMA Script (i.e., JavaScript) for a while, I found the definite reason. It is to permit the use of XML DOM. While HTML 4 specification has HTML DOM like `document.onload' and `select.options', XML DOM is used to solely permit element creations, additional attributes to be added on an element, and the like. Specifically, XML DOM is not about taking care of HTML. It is about taking care of an XML tree, which is agnostic to the represented data (e.g., it does not even know if it contains an HTML document). To be able to benefits from XML DOM functionalities like creating a new HTML tag, HTML 4 specification has to conform to the XML specification. Therefore, XHTML specification was born.