A
Andy Dingley
As I see it, this is the biggest disadvantage of XHTML.
However it is rather a killer!
Noting Jukka's comments, I may be out of date here. XHTML 1.1 as text/
html may now be permissible. If that's the case then it's usable for
IE, but still not recommended. Parsing behaviour will be as tag soup,
not as XHTML. If you're going to serve tag soup, at least stick to the
original recipe and serve it as HTML 4.01.
If, for the sake
of discussion, we ignore that fact, I really don't see any other
disadvantage of XHTML.
But what are its advantages on the web?
Yeah, I agree on you on this. For this transformation I'm loosing about
5 ms per page.
You're losing more than that - cache performance is the problem, not
page generation. With good front end caching on the server, you will
at worst double your page generation effort. With a poor caching
architecture and a mixture of clients, you effectively remove the
cache altogether. If you're going to browser-sniff like this, you
_must_ (if you care about performance) have a cache architecture that
understands the two different page formats and can cache both
independently. You can do this through a smart cache that understands
content-type, or sometimes more simply by using URL re-writing to
separate the pages entirely (their URLs become distinct, so all caches
see them as different)
I disagree with you on this.
Why? What's the _advantage_ of XHTML? Don't tell me XHTML is
different, tell me why it being different translates into a better end
result.
I see the strict syntax of XHTML (XML) as a good thing.
XML / XHTML syntax is no more strict than SGML / HTML. It's
_different_, but there are still rules. XML has the huge syntactic
advantage here that it's _simpler_, and thus humans other than Jukka
can author it accurately. I certainly can't author SGML by hand, using
all the optimisations, and get it right without validating. I can do
this for XML, and I can even do this for HTML 4.01 by ignoring many
optional optimisations in favour of a subset that's closer to XML.
Syntax just isn't "strict". The syntax defines a set of rules,
strictness is whether or not they're complied with. _Compliance_to_ a
syntax may be strict or less strict, but that's a matter for how its
_used_ and whether the consumer throws errors or tries to correct for
them. It's not the syntax itself that defines "strictness".
HTML is usually thought of as "less strict" only because the soup-
capable browsers that _parse_ it are less strict (this is one use case
with less strictness, not a formal definition of the syntax's inherent
strictness). There is no way that practical XHTML web browsers can be
able to be any more strict in the forseeable future, even if they're
fed something labelled as "XHTML / XML".
But in a long run, it might be easier to use DOM in JavaScript and to reuse code.
I have no idea what you mean here, or how that's relevant to XHTML /
HTML
XHTML have some benefits because of the strict syntax and
making XHTML code clearer.
XHTML browsers don't have any "strict" compliance to the syntax. The
XML syntax defines a narrower coding style for well-formed documents,
but we know that web authors will get this wrong. XHTML browsers
cannot practically refuse to display the page in that case, they'll
have to do their best to error correct, same as they've done for years
now.
XHTML code (to a competent author) is no clearer than HTML code (to a
competent author).
Non-well-formed XHTML code (from an incompetent author) cannot be
ignored by web browsers, any more than non-well-formed HTML code can.
Otherwise the browser can't display most of the web, which is
obviously useless.
Sorry, I didn't follow you on this one.
The style attribute is only there if the STYLE module is imported
(mind you, for that matter so is <font>, if you import LEGACY too).
Somewhere in the XHTML 1.1 docs there are notes that discourage the
use of inlined style attributes on elements, in favour of inline
stylesheets and #id selectors. I can't claim to care enough to have
exact the citation to hand.
Didn't know about <xslutput>. Don't think I'm gonna use it,
That's a pretty dumb choice then.
I don't see a point in HTML tags like <address> and some others. OK, we
have a tag to use to write addresses,
We don't - that's not what <address> is for. Read the HTML spec.
Nor is this at all relevant to HTML vs. XHTML.
What do you see as a biggest disadvantage of creating
your own XML Schema for the "HTML"?
You can't create one for HTML. You might create one for "HTML" (or
"My HTML with tweaks") but in that case it's no longer standard HTML
and thus it's difficult for browsers to know how to handle it.
I think I can count off all mobile devices then, can't I?
What do you mean? For one thing, the notion of "mobile devices" as a
special web agent class is rapidly diminishing. They're rapidly
becoming simply "web browsers" with attributes of smaller screens and
sometimes lower bandwidth. The old days of a specialised "WML web" or
even XHTML-MP are already past.