Wednesday, February 14, 2007

XML vs HTML

HTML (Hyper Text Markup Language) is the language we use to build webpages. If you right click on a webpage and [view source], invariably notepad will open with a page full of gobbledigook but somewhere near the top you'll see the tag html. This is the language of the web and it tells the web-browser WHAT to display.

HTML can also go hand in hand with CSS (Cascading Style Sheets) which tell the web-browser IN WHAT WAY to display the html instructions. For instance, go to the webreality website, right click on any area of white space to [view source], and about 20 lines down find the sentence which reads [div id="navigationcontainer"]. Underneath that you'll notice lots of tags within which read [li]. These are list items and are referring to the navigation links on the website:



However, it is the CSS which tells the website to display these links in a straight horizontal line, with the white dashes in between and in a white font.

So what I'm saying is that there are two main elements to building a website:

  1. HTML - Tells the web-browser what to display
  2. CSS - Tells the web-browser where and how to display

However, HTML has a cousin called XML - like HTML it also identifies elements in the webpage and it uses a very similar syntax to HTML. However XML is much more portable and can be used in many different types of applications. It is for this reason that, with the advent of Web2.0, XML will probably end up replacing HTML altogether.

However at the moment not all browsers support the XML language so for now HTML is still the primary language of the web. If you'd like to understand this more have a look at the video below.


No comments: