XML Application - XHTML

When I was researching for the last post on XML, I realized that there are numerous applications of XML that have almost achieved what XML hoped for.  These applications of XML seem to form the “universal language” or the common data format in a particular class of applications.

In this post, we will have a glance at XHTML.

Resisting the temptation of reiterating the history of World Wide Web from the early days of its inception in CERN, we will look at XHTML history and its other implications.

XHTML, as the name suggests, was derived from HTML and is an application of XML.  Hence the name has a ‘X’ prefixed to HTML.  W3C recommended XHTML version 1.0 sometime around January 2000.  It soon evolved to version 1.1.

XHTML is a stricter markup language compared to the lenient HTML.  HTML forgives when you miss a closing tag, or overlap two tag groups.  But XHTML must follow the basic rules of XML and has more stringent specifications.  The rules of XHTML basically follow that of XML.

  • There must be a DOCTYPE declaration
  • All tags and attributes must be in lower case
  • The document must be ‘well-formed’
  • Values assigned to attributes must be enclosed in quotes
  • No elements (tag sets) must be over lapping
  • All elements must be closed

Now, one would ask: why would we want to go from a lenient set of rules to one that brings in so many constraints?  Would it not make life easier to have loose rules?

On the contrary, the so called Web 2.0 phenomena, revolves around the issue of making life easier.  By having strict rules with respect to the rendering of web pages, the web masters, the developers, and the designers can rest assured that all the different browsers parse the XHTML document the same way.

Of course, there are still issues with the presentational elements but that is an issue with CSS.  In terms of XHTML, in my opinion, is quite a stable and good application of XML.

Leave a Reply