Creating XHTML sites

XHTML is the latest version of HTML by the W3C standards organization. It is basically HTML in an XML syntax. This section of my site is about how to create XHTML documents, and here you will be able to find a number of articles and examples, based on my own experiences. XHTML has a number of advantages over HTML, I will name a few of them:

Ok, so these advantages do not sound terribly cool, but really, MathML is pretty damn good-lookin’ and a blessing if you want to publish formulas on your website (which for a Beta student isn’t unlikely at all). And because you’re serving your page using the XHTML MIME type your page must be well-formed as it won’t display when it’s not, saving you a few headaches with stylesheets, and reduces the number of people nagging about your site not validating in W3C’s validator (you should be able to put up that validator link with more confidence now :)). And the XML tools… ah well, it’s just nice. Might come in handy someday. And who knows what other cool extensions the future will bring us (think Ruby and SVG).

So start making your site XHTML today! The sooner, the less work it will be later on :). A small warning in advance though, it requires a bit of discipline. If the site is a one-off job and you will lose control of it once its design is finished, it might be better to stick to serving the page using the old HTML ‘text/html’ MIME-type, unless you have a backend which generates valid XML at all times. Else you will inadvertently risk blocking non-IE users from viewing the site when it contains invalid XML.

External links