HTML to xHTML conversion
I was wondering how much work is involved in converting HTML 4.0 to xHTML and is it worth it?
A lot of it depends on how well the HTML code was structured to begin with, and how far you want to go in revampping a site. You'll find a lot of the shortcuts that validated under HTML will be flagged as invalid under XHTML. Sites with FRAMES are particularly problematic. While you're in there, you may want to look and see if you need to rethink some of your design to use CSS (if it isn't already).
As to being worth it, I think so, but I'm sure someone can make a valid argument for the other side of the issue.
Well do you have a link we can see?
Anyways sites with frames are problematic and wrong anyways. I dont know if it would be worth it if you already have valid semantic html.
There were a few significant changes that HTML 4.01 made to HTML 4.0 on 24 December 1999. Among them, in HTML 4.01 the FORM element is allowed to have a name. Chances are your pages conform to HTML 4.01 anyway, but the first step to put the correct DOCTYPE on each page and make sure that each passes the W3C Validator.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
XHTML™ 1.0 is simply an XML version of HTML 4.01, so that step is important. And once you've done that you just need to run each document through any old SGML / XML parser. HTML Tidy will do the trick nicely.
But is it worth doing? No, there is no advantage whatsoever in converting web pages from HTML 4.01 to XHTML™. You do want to get everything into HTML 4.01 Strict, though.
I do work in XHTML sometimes, but only when I'm going to run the thing through a processor and convert it to HTML. That way I can declare my own entities and/or use XSL transformations. Neither of which you want to do openly on the internet.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
I agree with Charles, for the most part. I prefer coding new sites in XHTML (for the stricter syntax, and I've personally had less trouble getting sites to work in multiple browsers) but the extra features often can't be used because of a lack of browser support. There's no pressing need to convert for the sake of doing so, as long as you are correctly using HTML 4.01 Strict.
If you don't want to download HTML tidy, there is an online version or two available.
Yes, I too, agree. I now normally code in XHTML 1.1, and like the fact that it forces me to code cleanly. If I make a mistake, something gets screwed up, something which isn't always the case with HTML 4.01. As for converting a website into XHTML, I wouldn't say it's necessary. HTML 4.01 strict is pretty close to XHTML 1.0 syntax (with a few minor exceptions). However, if you want a stricter, cleaner syntax, and considering there is a push towards XHTML, I would recommend you consider coding future websites you make in XHTML...
-Neal, the everyman's Mod.
My Own Niche in the Web
π ~= 3.14
3*14 = 42
Coincidence? I think not.
π = The Answer to Life, the Universe, and Everything.
awesome, i have been wondering the same thing and this helps me a lot. thx all
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)