Ted wrote:
According to : http://www.w3.org/MarkUp/2004/xhtml-faq#texthtml
"XHTML is an XML format; this means that strictly speaking it should be sent
with an XML-related media type (application/xhtml+xml, application/xml, or
text/xml). "
Does it really say that?! A second... I be damned, indeed! Sometimes I
feel like to call marines to smash W3C down. Unfortunately the absence
of W3C would be even more harmful than its presence, so needs to be
tolerated :-( :-)
No, text/xml has no relation with XHTML. XML parser has no idea about
additional layout/styling rules for (X)HTML element. You already
discovered it on <br> sample. Each Content-Type for a particular
content, this is how the Web works.
There is a lot of scum connected with XHTML, so before to proceed you
may want to check that your hosting provider supports XHTML as such.
For this you may use this primitive probe: save it as say probe.html
and upload it.
Open it: it shows up fine because it is served as Content-Type
text/html, so browser uses HTML parser on it, and as HTML it is a valid
markup: you are allowed to skip closing tag for list elements.
Now let's try to find out if server admin has an extension associated
with Content-Type application/xhtml+xml (XHTML). In the US the most
common extensions for this are .xhtml and .xht
So try to change the extension first to .xhtml then to .xht, upload and
view in Firefox. The sign that the page is served and parsed as XHTML
will be error message "closing tag missing". From this point out you
have a real XHTML page you can play with. It also means that
unfortunately this page is not available to Internet Explorer users
anymore (IE doesn't support XHTML and it will not do it in any near
future).
// probe page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />
<title>XHTML Probe</title>
</head>
<body>
<ul>
<li>Item 1
<li>Item 2
<li>Item 3
</ul>
</body>
</html>