As we have just noticed the real question should acutally be Why is semantic markup – be it HTML or XHTML – better than non-semantical, presentational markup?
What’s the purpose of XHTML?
To be honest using XHTML instead of HTML (I am speaking of the strict-DTDs is most of the times a burdon.
- It should be send as
application/xhtml+xml(as Anne never gets tired of pointing out). - Internet Explorer cannot handle
application/xhtml+xml. Content negotiation as described in Mit dem Apache XHTML-Seiten ausliefern is a nice workaround. - XHTML, being a XML-application, demands wellformedness. This can easily break by retrieving information from external sites or even by using outdated internal sources.
- I’ve personally had hard times including
javascriptorcsslocally in a XHTML-document. The problem is how to correctly comment theCDATA-sections to hide them from older browsers. The correct way to include javascript and CSS in XHTML document introduces the problem – and a apparent solution. It wouldn’t work for me.
So, XHTML causes a lot of problems. Some of these problems on the other side are XHTMLs strengths.
The enforcement of wellformedness makes developing webpages actually more comforting since it makes finding problems in markup, stylsheet or javascript easier. It resolves ambiguities HTML sometimes cannot resolve, i.e. XHTML demands of the writer to be clear, not nesting elements in some chaotic way which the parser has to sort out.
The only real benefit of using XHTML over HTML is its extensibility as the following quote suggests:
The reason you really want to use XHTML is when you are going to use other markup languages like MathML and mix them together.
The misbehavior of THE browser regarding documents sent as application/xhtml+xml nullifies these advantages, though. The alternative would be to abandon the support of THAT browser if one would like to or is forced to use extensions like Ruby Annotation, LiteraryML, MusicML or MathML.
Conclusion
To answer the question from the first paragraph Why is semantic markup – be it HTML or XHTML – better than non-semantical, presentational markup?
one should read through the just recently published entry The Economics of XHTML on Pieces Of Rakesh and the comments to that entry. Reading that entry please keep in mind that it’s actually ‘semantic vs. presentational‘ rather than ‘html vs. xhtml‘.
Nailing it down
It does not matter whether one uses HTML 4.01 strict or XHTML 1.0 strict / 1.1 as long as the markup is done semantically or sometimes even structurally but NEVER presentationally.
Due to all the obstructions XTHML holds it seems reasonable to use HTML 4.01 strict. XHTML opens the can of extensibility, though.





{ 1 } Trackback
[...] r: Markup — Steffen @ 03:08
–>
I have asked that question some time ago and came to the conclusion that it’s more a que [...]
Post a Comment