www.webdeveloper.com
Results 1 to 7 of 7

Thread: HTML to xHTML conversion

  1. #1
    Join Date
    Aug 2004
    Posts
    1

    HTML to xHTML conversion

    I was wondering how much work is involved in converting HTML 4.0 to xHTML and is it worth it?

    Cheers

  2. #2
    Join Date
    Nov 2003
    Location
    Worthington, OH, USA
    Posts
    3,634
    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.

  3. #3
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,141
    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.

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    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"
    "http://www.w3.org/TR/html4/strict.dtd">


    XHTML&trade; 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&trade;. 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

  5. #5
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    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.

    Adam
    "If you’re not using valid HTML, then you haven’t created a Web page. You may have created something else, but it isn’t a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History

  6. #6
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    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...

  7. #7
    Join Date
    Aug 2004
    Location
    US
    Posts
    544
    awesome, i have been wondering the same thing and this helps me a lot. thx all

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles