Forum Moderators: open

Message Too Old, No Replies

XHTML question

         

RammsteinNicCage

4:16 pm on May 25, 2003 (gmt 0)

10+ Year Member



I'm in the process of converting a site of mine into xhtml and I've been reading some of the posts here about it and am getting a little confused. As far as I can tell, all xhtml really does is make your code look neater (lowercase, proper nesting, closing tags), but it seems like everyone makes such a big deal about it like it's some wonderful new invention. Am I missing something?

Also, is there a program that can mass convert a site to xhtml in a click or two? :)

edit: one more question: if I have a css class named .pageTitle, with xhtml would that have to be converted to .pagetitle?

Jennifer

g1smd

4:26 pm on May 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I haven't found it worth the bother going beyond valid HTML 4.01 code so far.

I'm told that it is a small step from there to XHTML 1.0, but you are still really just serving up HTML rather than the bigger step into XML even when you do that.

papabaer

4:49 pm on May 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, and this is an important point, when coding XHTML you are in fact, formatting HTML as XML. Spend some time reading the W3.org specs, pay attention to the intended purpose behind MODULAR XHTML, give XHTML 2.0 (working draft) a glance for even more insight.

Yes, there are a number of code editors that can do mass conversions to varying degrees. I would suggest however that you focus on your new pages first, and weigh the value of converting legacy pages against returns.

The class .pageTitle is different from .pagetitle -- CSS is case sensitive and does not follow the markup rules assigned to XHTML other than as applied to head/page markup, even here, CSS's case sensitive naming convention is exempt.

Wertigon

6:29 pm on May 25, 2003 (gmt 0)

10+ Year Member



Actually Papabear, it all depends on the MIME type.

You can basicly serve up XHTML 1.0 in two different ways; Either as text/html (HTML MIME type) or application/xhtml+xml (XHTML MIME type). If you serve it up as text/html the browser will still treat your code as HTML. If you use the XHTML MIME type, then yes you're coding HTML in XML. Although using application/xhtml+xml is risky at best, since IE6 doesn't support it, and your page breaks in the rest of the browsers if you made one silly mistake (like forgot that it's supposed to be <br /> and not <br>).

As far as XHTML is concerned though - Don't bother unless you want to display some sort of XML language on your webpages (like MathML), it's just not worth it at this point.

papabaer

8:46 pm on May 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wertigon, I'm aware of the mime type and you are correct in noting it. There have been several lengthy discussions regarding this issue, but for the sake of simplicity, an XHTML document is well... simply HTML formatted as XML. How it is served, does depend on the mime type. That's not the issue here.

The point is, should XHTML be used in place of HTML? The anwser is a definite yes! At least if forward compatibility and device independence is concerned.

Ignore it? That simply does not make sense at all. The learning curve may be easy, but nothing will supplant familiarity as XHTML 1.0 and XHTML 1.1 are replaced with XHTML 2.0 when the real power of XHTML will be revealed.

Granted, it will be sometime yet, but just as with CSS, would you rather learn it early and find a comfort zone? Or would you prefer to struggle to catch-up to those who have passed you by? The choice is a simple one.

Wertigon

9:14 am on May 26, 2003 (gmt 0)

10+ Year Member



The point is, should XHTML be used in place of HTML? The anwser is a definite yes! At least if forward compatibility and device independence is concerned.

Actually, the point is "Is it worth it to convert HTML to XHTML?" That answer is a little more tricky...

If you think your site would benefit to be viewed on, say, a PDA, then yes, XHTML is the way to go, and it is also the way to go if you want to make your site accessible and/or code for the future. New documents should always be written in XHTML if possible.

With the implementations of today, however, there is hardly any difference between XHTML and HTML syntax-wise and stuff on the desktop side. HTML 4.01 works well enough still, and until IE starts supporting XHTML properly there really is no reason to use it, with the exception of using XHTML together with another form of XML (like MathML), or using it to learn it. Converting XHTML to HTML will save you money in the long run, no doubt about that. But only if you convert to XHTML 2.0 from the start.

Ignore it? That simply does not make sense at all. The learning curve may be easy, but nothing will supplant familiarity as XHTML 1.0 and XHTML 1.1 are replaced with XHTML 2.0 when the real power of XHTML will be revealed.

Granted, it will be sometime yet, but just as with CSS, would you rather learn it early and find a comfort zone? Or would you prefer to struggle to catch-up to those who have passed you by? The choice is a simple one.

I'm not saying you should ignore it. But the way I see it, with the implementations and usage of today, there's hardly any real *visible* benefit of converting to XHTML 1.0. Why? Because XHTML 2.0 won't be backwards compatible. Once XHTML 2.0 comes along and browsers start supporting it, then yes, I'd be willing to change to that. But I find it hard to get motivation to convert to XHTML 1.0 when 2.0 will be the language to use. XHTML 1.0 seems to me to be a dead end.

It's like this: I have a site that I've written in HTML. I convert it to XHTML 1.0, and the conversion took maybe two weeks time all in all. Two years later XHTML 2.0 shows up and gets good browser support. I then "must" convert to 2.0, and that also takes time.

Why convert twice (HTML -> XHTML 1 -> XHTML 2) when I can do the jump to XHTML 2 directly? Until XHTML 2 comes along conversion isn't worth it IMO.

Nick_W

9:19 am on May 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Going from HTML to CSS/XHTML [webmasterworld.com]

Good discussion...

Nick