banner
Welcome to HTML.co.uk, the number one resource for all news, information, and happenings regarding HTML.

Updates: HTML.co.uk has just been relaunched. Subscribe to our RSS Feed to stay on top of HTML news and techniques.
Nov
22nd

Converting HTML Based Web Pages into XHTML: Our Quick Guide

Author: Editor | Files under HTML Tutorials
Tags for this article: , ,

Converting HTML based web pages into XML is not a big deal but you need to follow certain simple steps for doing it in the correct way. You should always convert the pages into some semantically meaningful and application specific mark up language. One of the semantically meaningful markup languages is the MathML which is also known as chemical mark up language. The W3C’s XHTML recommendation ahs provided a convenient list of differences between these two languages. There are a number of differences that should be considered while understanding how to convert HTML based web pages into XML. Some differences would even surprise HTML developers because these are so simple and unique.

It is already known that XML element names are case sensitive or in a hypothetical XML form of HTML. The difference can be explained with an example as <img> tag would actually represent a different element than <IMG> or <Img>. Hence the XHTML authors opted for all lower case element names which solved this confusion. On the other hand various other empty elements that are represented in HTML as <br>, <hr>, <img>, etc. must use some special XML the empty element tag form with a slash. Just putting a slash can solve this problem as <br> tag becomes <br/>. Then there are certain browsers that may not understand XML. Some of these browsers may choke on this empty form.

This problem can be easily solved as well as you can put proceed the slash with a space. Hence a tag becomes <br /> instead of the earlier <br/>. The above mentioned is one of the very rare and you can only blame the browser vendor. But now you can easily solve such problems by putting a space after the slash. But there is another very easy and time saving way to convert the existing HTML documents into the XHTML form. The easy way is to use Dave Raggett’s free HTML Tidy which is a very useful utility. This programme is available at the W3C website and is totally free to use as well. The utility Tidy can work on almost all platforms and a wide variety of command parameters which actually direct its processing.

A wide number of vendors and developers have actually incorporated or integrated Tidy into their own product that proves it utility. On some Windows based devices there is a very popular tool which is named as Chami.com’s free HTML kit. But then converting your HTML documents to XML application is a bit difficult. HTML element names don’t have an inherent meaning which is actually a hallmark of all XML applications as a normal person thinks of them. Converting them is not that easy as it has a lot of commands involved in it and you can easily find all of them online. Installing some application like Tidy is a better option because such programmes are very user friendly and will have minimum of hassle. It is very easy to install and you can easily download it online as well.

Post a Comment