« Hint to Microsoft: State Diagrams are Useful | Main | MOSS 2007 Trainwreck Coming »
January 15, 2007
Respecting XHTML's XML Heritage
Pete Forde has an interesting post on his blog, unspace.ca where he details a process for extending the Prototype library to support extra attributes on XHTML entities. What's really interesting about this, to me, is that it hasn't been done before. I've previously experimented with adding extra elements to HTML entities, but the pages won't validate. That lack of W3 validation made me nervous about using that strategy in a production environment. But apparently Pete has researched the issue and determined that all modern browsers render pages properly even if the elements have crazy extra attributes added.
But what does this have to do with XML? HTML is a derived from XML but with some tweaks to the syntax and an intentional prohibition against extending the language to add functionality. XHTML is like HTML but more rigorously formatted to comply with XML requirements as "true" XML. XML can be extended arbitrarily to support new attributes on elements. But for some reason, XHTML won't validate when it includes these "extra" attributes. The W3 ignored the heritage of XHTML when they limited it to a subset of XML that only copies the functionality of HTML (a bastard stepchild to begin with).
Anyway, I'm inarticulate compared to Pete and probably just muddying the waters here, so check out his post to get a better explanation of these concepts. Or, if you're really interested, read O'Reilly's XML in a Nutshell. It contains a very lucid, accessible, history of XML and XHTML.
Posted by ashusta at January 15, 2007 05:51 PM