HTML vs XHTML: A Brief Introduction

First developed in 1980 by physicist Tim Berners-Lee, currently HTML or Hyper Text Markup Language is perhaps the most well-known markup language for web page design, allowing the usage of simple codes or tags to process, define and present a scintillating web page. Considered as the building blocks of all websites, HTML provides a means to create structured documents by denoting structural semantics for text and images. Embedding client-side scripting (eg: Java-scripts) and reference to Cascading Style Sheets (CSS) further enhances it’s flexibility and control over a web page.

However, while HTML was based on Generalized Markup Language (later SGML) based markup rules, a new markup language titled XHTML (eXtensible HyperText Markup Language) was formulated to address the general document problems and other more complex and human-oriented features persisting with SGML. Based on XML (Extensible Markup Language), XHTML allows greater control over the “meta language” feature, i.e allowing users to create any tags needed (hence “extensible”) and then describing those tags and their permitted uses. Owing to it’s simplicity and flexibility, XHTML quickly became popular and became W3C Recommendations since January 2000.

However, not much of a difference lies in between XHTML and HTML, as XHTML is basically a ‘reformulation of HTML as an XML application‘, or has the same set of element types and semantics as HTML, heavily mirroring it (one of the prime reasons for the smooth transition). But there are many core syntactical differences, mainly that all XHTML elements must be properly nested, must always be closed, must be in lowercase and always have one root element present. Other notable difference lies in Behavioral response to Scripts and CSS. These differences allows for consistency in the syntax and paves it’s way for more rigorous document creation.

Additionally, XHTML incorporates XSLT (Extensible Style sheet Language Transformations) technology, which is tremendously useful to create various new resources automatically from an XHTML document (eg: creating table of content or RSS feed directly from web page). XHTML clearly is easier to learn and maintain and gains an upper hand with it’s robust set of features and future readiness.

However, for the end user, not much of a difference would arise in an HTML created web page or XHTML created document. Infact, the only way to make the markup language recognize the document as XHTML is by using the xmlns attribute in the tag (xmlns=”http://www.w3.org/1999/xhtml”). Both HTML and XHTML created document would be perceived as mostly same while viewed from the web browser.

So the question arises, which one to choose? Perhaps the simplest answer to this paradigm would be “Using the right tool for the right job”. A web designer would have to evaluate the status of his project and the extent of features he wishes to use. For future readiness and using advanced features of searching, indexing and parsing, XHTML would serve the purpose. However, for simplicity and widespread usage (as IE still doesn’t support XHTML), HTML would more than suffice. In the end though, both are equally versatile, flexible and offer unprecedented control over web page coding.

Advertisements

~ by gravito on February 18, 2011.

2 Responses to “HTML vs XHTML: A Brief Introduction”

  1. […] the original post here: HTML vs XHTML: A Brief Introduction « Voice of the System Shocked Related Posts:Introduction to XHTML | XHTML XHTML is a stricter and cleaner version of HTML. What […]

  2. Hiya! I just want to give an enormous thumbs up for the great data youve gotten here on this post.
    I might be coming back to your weblog for more soon.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: