All in the <head>

– Ponderings & code by Drew McLellan –

– Live from The Internets since 2003 –

About

XHTML 2.0 again

14 September 2003

Although not particularly meaning to think about it, I accidentally began thinking about XHTML 2.0. This wasn’t tremendously desirable, as when I think about things I like to draw some sort of conclusion, and with XHTML 2.0 being so young (unfinished) and controversial, I was afraid of not being able to reach one. However, I had started thinking by this point so it was all somewhat irrelevant.

The big fuss about XHTML 2.0 is that although it is semantically rich and altogether more up-to-date architecturally, it fails to maintain an acceptable level of backwards compatibility with current version of XHTML and HTML and also the user agents in common use. Add its additional complexity (well, it’s hardly complex but it’s a fair bit more complex than simple HTML) and it becomes more difficult to use as well as consume. But …

Isn’t this just XML we’re talking about? XHTML 2.0 is just an application of simple XML, just as XHTML 1.0 was before it. The difference is that unlike its predecessor, XHTML 2.0 doesn’t try to match HTML 4.01 tag-for-tag. But, it’s just XML. It’s a language for marking up a web page in a meaningful (meaning-full) way. No one says that’s what has to be consumed by older user agents do they? Has the whole world lost its head and forgotten XSLT?

The important thing about XHTML 2.0 is that it enables a developer to mark up content for what it is. It’s this document that can be consumed by smart semantically-aware search engines. As for browsers, if they don’t understand XHTML 2.0 natively then I don’t give a stuff. Transform the document with XSLT to XHTML 1.0 and serve them that instead – programmatically. Those user agents that don’t understand XHTML 2.0 can’t make use of the extra information anyway, so transform to 1.0 and let them deal.
It’s not like you’d even need to write the XSLT yourself – once an XHTML 2.0 to XHTML 1.0 stylesheet has been written then it’s written – snag it, use it. You don’t even need to know what XSLT does. Surely it really is that simple? That’s what we have this technology for.

So, write once in XHTML 2.0. Serve twice – once in raw format for UAs than understand XHTML 2.0, once with a standard XSL stylesheet attached to transform into XHTML 1.0 at the server. Sounds like a good solution to me.

As I said, I didn’t mean to start thinking about it.

- Drew McLellan

Tags

Comments

  1. § Jason: Agreed. I think it is that simple.
  2. § Nathan Pitman: Drew, I think that you think too much. :~
  3. § Dysfunksional Monkey: I don’t understand why its even been created. XHTML is the transition from HTML to XML. I’m sure that there only needs to be a single stage - its not as if we’re going from Visual Basic to Arabic, is it? We’re only going from one mark-up language to another.

    Tag your information using XML, try (as an information architect) to make it as symantically correct as possible, then use XSL to translate for older/standards-incompetent (sorry, incompliant) browsers. Serve it up lightly sprinkled with CSS for those which are. Done.
  4. § Doug: I’m writing an XHTML 2.0 to XHTML 1.1 stylesheet. There are several steep obstacles in the way though.

    XHTML 2.0 Navigation Lists need richer structural support. Want your new pop-up menu to have a border? The list items don’t have a container element to allow you to do that. Furthermore, navigation lists need to rename their label and li to something more specific for referencing. I like nh(navhead) hb(navbody) and ni(navitem). A navseperator would be nice too. Attributes for specifying the direction of the popup, and its alignment, would also be nice. Effective keyboard navigation of such a navlist is impossible with current html interfaces, so its for point and clickers only.

    everything can have a cite or href link? Now that is just hell to write. Duh, put it in an a tag… easier said then done. Furthermore, navigation lists would break if you put an href or cite link on anything but a navigation list item. Even the html, head, and body elements can be turned into links! this is sheer lunacy. I like the idea, but tone it down some, please.

    no cellspacing attribute on tables? then at least require that tables no longer have any cellspacing, and that the margins of td and th tags now fill in this role. I’d love this. Kill cellspacing, but make sure you require that it is killed!

    preserve all of the meaningful inline text tags from xhtml 1 please. I can take q to quote. They didn’t replace acronym though!

    Anything can be turned into an image? O.K., i think i can handle what they want, but it seems rather odd. Even so, <html src=”WTF.gif”> seems like an appropriate reaction.

Photographs

Work With Me

edgeofmyseat.com logo

At edgeofmyseat.com we build custom content management systems, ecommerce solutions and develop web apps.

Recent Links

Affiliation

  • Web Standards Project
  • Britpack
  • 24 ways

About Drew McLellan

Photo of Drew McLellan

Drew McLellan has been hacking on the web since around 1996 following an unfortunate incident with a margarine tub. Since then he’s spread himself between both front- and back-end development projects, and now is Director and Senior Web Developer at edgeofmyseat.com in Maidenhead, UK (GEO: 51.5217, -0.7177). Prior to this, Drew was a Web Developer for Yahoo!, and before that primarily worked as a technical lead within design and branding agencies for clients such as Nissan, Goodyear Dunlop, Siemens/Bosch, Cadburys, ICI Dulux and Virgin.net. Somewhere along the way, Drew managed to get himself embroiled with Dreamweaver and was made an early Macromedia Evangelist for that product. This lead to book deals, public appearances, fame, glory, and his eventual downfall.

Picking himself up again, Drew is now a strong advocate for best practises, and stood as Group Lead for The Web Standards Project 2006-08. He has had articles published by A List Apart, Adobe, and O’Reilly Media’s XML.com, mostly due to mistaken identity. Drew is a proponent of the lower-case semantic web, and is currently expending energies in the direction of the microformats movement, with particular interests in making parsers an off-the-shelf commodity and developing simple UI conventions. He writes here at all in the head and, with a little help from his friends, at 24 ways.