HTML or XHTML??

S

Steve Pugh

Cyberdog said:
When would you use XHTML for a web site as apposed to HTML, and
why.

Personally speaking I have three reasons that make me use XHTML:
1. A client asks for it.
2. I want to piss off MSIE users (as that browser can't cope with
properly served XHTML).
3. I feel like it.

For other people there may be two more reasons:
4. They have some XML that for some reason can not be transformed into
HTML but which can be transformed into XHTML (personally I think this
is bogus).
5. It's psychologically easier for them to switch from ye olde
presentational oriented markup coding to semantic markup if they alse
switch from HTML to XHTML at the same time (this is basically the
Zeldman argument, though his book rather confuses the issue via
hypebole and misdirection).

Really a sub-set of 5 is the fact that with XHTML you can validate
code as stricter than strict in _some_ respects (all closing tags
required, etc.) without the need for a custom DTD. But that's a QA
issue that really should be solved via the appropriate QA tools rather
than via the choice of markup language.

There may be other reasons in a few cases but as XHTML 1.1 is not
suitable for use on the WWW and as XHTML 1.0 offers nothing new over
HTML 4.01 there actually aren't any _technical_ reasons to use one
over the other.

Steve
 
S

Steve Pugh

altamir said:
[snip]
There may be other reasons in a few cases but as XHTML 1.1 is not
suitable for use on the WWW

Why?

XHTML 1.1 (as opposed to 1.0) should be served as
application/xhtml+xml rather than text/html and IE doesn't know what
to do with that content-type. As most of the WWW uses IE that means
that XHTML 1.1 isn't suitable for the WWW.

Steve
 
W

Whitecrest

Personally speaking I have three reasons that make me use XHTML:
2. I want to piss off MSIE users (as that browser can't cope with
properly served XHTML).

Good strategy. Piss off 80% of your customers....
 
S

Steve Pugh

Whitecrest said:
Good strategy. Piss off 80% of your customers....

Sorry, that first line should have read "that _would_ makeme use
XHTML".

Apart from one or two test pages I don't actually have anything served
as application/axhtml+xml.

But, hey if they can't be bothered to use the right browser to acces
my site then that's their problem, not mine. Right?

Steve
 
S

Spartanicus

Steve said:
XHTML 1.1 (as opposed to 1.0) should be served as
application/xhtml+xml rather than text/html and IE doesn't know what
to do with that content-type. As most of the WWW uses IE that means
that XHTML 1.1 isn't suitable for the WWW.

Strange reasoning, the logic conclusion would be that IE isn't suitable
for the WWW.
 
W

Whitecrest

Strange reasoning, the logic conclusion would be that IE isn't suitable
for the WWW.

Or a more logical conclusion would be XHTML and the other browsers
aren't.....
 
K

Kevin Scholl

Spartanicus said:
Strange reasoning, the logic conclusion would be that IE isn't suitable
for the WWW.

Heh heh. Well, compared to the superior alternatives... :)

--

*** Remove the DELETE from my address to reply ***

======================================================
Kevin Scholl http://www.ksscholl.com
(e-mail address removed)
 
S

Steve Pugh

Spartanicus said:
Strange reasoning, the logic conclusion would be that IE isn't suitable
for the WWW.

One of the guiding principles of the WWW is
"Be liberal in what you accept, and conservative in what you send"

If I was building a browser I would make sure that it can accept
XHTML. If I was building a web site I would make sure that it doesn't
sent XHTML.

Steve
 
G

George Self

Steve said:
Personally speaking I have three reasons that make me use XHTML:
1. A client asks for it.
2. I want to piss off MSIE users (as that browser can't cope with
properly served XHTML).
3. I feel like it.

For other people there may be two more reasons:
4. They have some XML that for some reason can not be transformed into
HTML but which can be transformed into XHTML (personally I think this
is bogus).
5. It's psychologically easier for them to switch from ye olde
presentational oriented markup coding to semantic markup if they alse
switch from HTML to XHTML at the same time (this is basically the
Zeldman argument, though his book rather confuses the issue via
hypebole and misdirection).

Really a sub-set of 5 is the fact that with XHTML you can validate
code as stricter than strict in _some_ respects (all closing tags
required, etc.) without the need for a custom DTD. But that's a QA
issue that really should be solved via the appropriate QA tools rather
than via the choice of markup language.

There may be other reasons in a few cases but as XHTML 1.1 is not
suitable for use on the WWW and as XHTML 1.0 offers nothing new over
HTML 4.01 there actually aren't any _technical_ reasons to use one
over the other.

Steve

Of course, one other reason to switch is that HTML is a dead language. There
is no more development being done with HTML - no more RFPs - no more
changes. All new development in Web-based presentation is toward CSS and
XML (remember that XHTML is just an XML-based reformulation of HTML). Steve
is absolutely correct in stating the XHTML 1.0 offers no advantage over
HTML 4.01. It was intentionally designed to be that way to ease transition.
However, as the Web continues to mature, all new development will shift
away from HTML.

The Web Consortium's HTML page lists this goal for XHTML:

To develop the next generation of HTML as a suite of XML tag sets with a
clean migration path from HTML 4. Some of the expected benefits include:
reduced authoring costs, an improved match to database & workflow
applications, a modular solution to the increasingly disparate capabilities
of browsers, and the ability to cleanly integrate HTML with other XML
applications. (see: http://www.w3.org/MarkUp/ ).

HTML 4.01 works just fine now. However, I suspect that in a few years it
will be as archaic as HTML 2.0 is today. IMHO like it or not, you may as
well get used to XHTML. It's where the Web is going.

--George
 
B

Bertilo Wennergren

George Self:
Of course, one other reason to switch is that HTML is a dead language. There
is no more development being done with HTML - no more RFPs - no more
changes. All new development in Web-based presentation is toward CSS and
XML (remember that XHTML is just an XML-based reformulation of HTML). Steve
is absolutely correct in stating the XHTML 1.0 offers no advantage over
HTML 4.01. It was intentionally designed to be that way to ease transition.
However, as the Web continues to mature, all new development will shift
away from HTML.

But if you're not going to use any of the XML-ishness of XHTML, there is
no reason to switch from HTML 4.01 until the day when people start using
user agents that don't understand HTML 4.01. (OK, I know most people use
such user agents already, e.g. MSIE, but let's pretend for now that MSIE
does understand HTML 4.01. At least it understands it better than XHTML.)

I myself have a few uses for the XML-side of XHTML (and I like the
cleaner syntax of XHTML), so I choose to serve my pages as XHTML 1.1 or
XHTML 1.0 depending on what the user agent claims to be able to handle,
but I guess most web authors will be just as well off, or even better
off, staying with HTML 4.01 for quite a while still.
 
S

Samuël van Laere

George Self said:
HTML 4.01 works just fine now. However, I suspect that in a few years it
will be as archaic as HTML 2.0 is today. IMHO like it or not, you may as
well get used to XHTML. It's where the Web is going.

--George

Looking at all that Flash sh*t that, that doesn't seem to be the way to go.
So where is the web going in the future, or better what will it be like?



With regards,
Samuël van Laere
 
A

altamir

XHTML 1.1 (as opposed to 1.0) should be served as
application/xhtml+xml rather than text/html

Have you seen American Megatrends site (http://www.ami.com)? It's very well
designed and valid XHTML 1.1. Pages are served as text/html.
IE doesn't know what to do with that content-type. As most of the WWW
uses IE that means that XHTML 1.1 isn't suitable for the WWW.

AMI example show that maybe XHTML 1.1 *is suitable* for the WWW.
 
M

m

altamir said:
Have you seen American Megatrends site (http://www.ami.com)? It's very well
designed and valid XHTML 1.1. Pages are served as text/html.

It may have been in the past, but w3's validator is throwing 23
errors this morning.

There is one cadgey thing on it, though. The top tab navigation
is the first use of hover overlines I've seen that seems really
effective. Possibly because the tabs are above even the logo.
 
B

Bertilo Wennergren

altamir:
Have you seen American Megatrends site (http://www.ami.com)? It's very well
designed and valid XHTML 1.1. Pages are served as text/html.
AMI example show that maybe XHTML 1.1 *is suitable* for the WWW.

The AMI pages includes among other things this:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

The last attribute indicates the natural language used in the content of
the page: english. MSIE doesn't have a clue what 'xml:lang="en"' means,
and will certainly ignore it. The same goes for many other user
browsers, and probably also for most search robots.

In HTML 4.01 and in XHTML 1.0 we can, and should, write 'lang="en"' (in
XHTML 1.0 we should also write 'xml:lang="en"'). That will be understood
by many or even most user agents, and by many search robots.

Thus HTML 4.01 and XHTML 1.0 are suited for the WWW as it is now, but
XHTML 1.1 is not.

There are other details like this in XHTML 1.1.
 
S

SteW

altamir said:
Have you seen American Megatrends site (http://www.ami.com)? It's very well
designed and valid XHTML 1.1. Pages are served as text/html.
XHTML 1.1 pages *must not* be served as text/html, they may be served as
application/xml, they *should* be served as application/xhtml+xml. See
http://www.w3.org/TR/xhtml-media-types/#summary

However, when xhtml 1.1 is served properly, ie gives a file download
dialogue box instead of displaying the page.

XHTML 1.0 may be served as text/html and ie is happy enough

Regarding the AMI page design: No tables, hooray. But it is still a
fixed width design, and why are the _only_ headings h6?

Ste W
 
A

altamir

The AMI pages includes among other things this:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

The last attribute indicates the natural language used in the content
of the page: english. MSIE doesn't have a clue what 'xml:lang="en"'
means, and will certainly ignore it. The same goes for many other user
browsers, and probably also for most search robots.

In HTML 4.01 and in XHTML 1.0 we can, and should, write 'lang="en"'
(in XHTML 1.0 we should also write 'xml:lang="en"'). That will be
understood by many or even most user agents, and by many search
robots.

You can still use <meta http-equiv="content-language" content="en" /> which
is well understood.
 
A

altamir

It may have been in the past, but w3's validator is throwing 23
errors this morning.

I guess you've checked only the main page. There're only 4, 5 minor errors.
23 is because of the error propagation. I'm not gonna excuse them, but it's
really hard to keep all your pages valid all the time on such a huge site.
 
B

Bertilo Wennergren

altamir:
Bertilo Wennergren
You can still use <meta http-equiv="content-language" content="en" /> which
is well understood.

Indeed. Or you can even do the right thing, and send that info in an
actual HTTP header.

But sometimes certain parts of a document, or even certain words, are in
another langugage, and then we should do e.g. this:

<p>Some text in English. <span lang="fr">Bon jour!</span>.
More English.</p>

In XHTML 1.0 (in backwards compatibility mode) that should be:

<p>Some text in English. <span lang="fr" xml:lang="fr">Bon
jour!</span>. More English.</p>

In XHTML 1.1 that becomes:

<p>Some text in English. <span xml:lang="fr">Bon jour!</span>.
More English.</p>

And MSIE, and many others, are lost.

And then we have things like link anchors named with "name='whatever'".
You can't do that in XHTML 1.1. You have to use "id='whatever'". Some
old browsers won't grok that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top