Why are you still using XHTML?

I am puzzled by the fact that some people still use XHTML, the HTML-clone which was born, because XML fans couldn’t bare to write <br> and instead desired to write <br />.

The difference between XHTML and HTML is that XHTML has a more complex doctype, forces self closing tags and has more strict validation rules that may have made sense back them but they don’t really make sense now.

XHTML promised interoperability with other XML languages, what it didn’t promise was browser support for them.

The latest release of XHTML that actually has browser support is from 2001, that’s even older than IE6.

Writing in XHTML is worthless if you do not validate it(XML in general is only useful if you actually plan to validate it), the problem is that both the validation rules and the validators are unreasonable also well-formed/academic markup will not guaranty browser support, it even makes it harder to support browsers because the strict rules make it hard to write hacks for lesser browsers. Because of this, most people who write XHTML don’t bother to validate it, which makes the whole thing dubious.

And there was XHTML 2.0, which shows that the XHTML group still doesn’t understand how browsers and users work, they dropped backward compatibility ignoring millions of users and the fact that old browsers don’t upgrade magically overnight. Because of these XHTML 2.0 failed misserably.

We are now in 2011, we have HTML5, which can optionally act as XML if the developer wants enforced well-formed-ness(if the browser actually cares to enforce it), it supports both <br> and <br/>, the developer decides the usage, which is good because nowadays mashups are very common and separate syntaxes make this painful.

The HTML5 doctype is much shorter while providing access to the ‘future’ elements and backward compatibility all the way back to IE6.

Despite all this, why are some people and frameworks still using XHTML 1.x?

Tags: , ,

  • Pingback: HN Firehose

  • Pingback: fantomaster

  • mario

    The most funny thing is that you get odd looks if you actually deploy real XHTML-Strict with the correct mime type.

    In other news: I just made myself unpopular today by omitting double quotes around alphanumeric=”attributes”. What I’m saying: The developer community isn’t yet ready for HTML5 and making the SGML serialization first class again.

  • Pingback: Mhd Zaher Ghaibeh

  • http://twitter.com/SeanJA Sean Sandy, BCS

    I use it to get rid of unknowns… What happens when you have ? I have no idea, but if the tags are closed, I can see what it would do.

    Also, we don’t have html5 yet… we still have old browsers.

  • Anon

    If you use XSLT to generate HTML, the HTML has to be valid XML as well.

  • http://nolovelust.com Copluk

    I am using it on all my mobile sites. once you start validating xhtml you feel like you are doing something wrong if you don’t write valid. makes you obsessed with validation :)

  • Crystoll

    well perhaps since xhtml has specification and compatibility, html5 is horrible mess in compatibility front and specification itself comes in 2014, maybe… ;)

  • Anonymous

    Actually it’s a standardization of what browsers already did. The html5 doctype works good even with IE6.

    Most stuff that HTML5 introduces can be implemented with JS libraries, like the placeholder attribute, the most of the webforms part, heck you could even do a canvas implementation with 1×1 pixel table cells, it will be slow sure but the point is most stuff can be “back ported”.

    Also most HTML5 elements degrade gracefully, see videojs for reference.

  • Anonymous

    You can’t use HTML5 webforms if you have a valid XHTML, which means you have to sacrifice imporant usability just for the sake of well-formed-ness, which is crucial on handsets.

  • Anonymous

    HTML5 actually specifies handling of incorrect syntax.

    HTML5 works in old browsers, see my previous comment.

  • http://profiles.google.com/cay.horstmann Cay Horstmann

    If you only publish for the web, maybe HTML is fine. But for books (both paper and e), XML based toolchains are common, and it is pretty easy to transcode XHTML (or XML-conformant HTML 5) into whatever XML the publisher needs.

  • http://www.register-web-domain.in domain registration India

    I think that, Now it is in under development. I heard that, HTML is fine to work. It is extra-ordinary. Thank you for sharing this useful information.

  • http://www.webhostings.in/ Hosting India

    XHTML is a markup language originally hoped to someday replace HTML on the Web.XHTML has many good potential applications, and I hope it continues to thrive as a standard.