Mark, an Invited Expert to the HTML WG, has written a short essay to explain why, in his thought, XHTML 2.0 is to become a new lingua franca. As you probably know if you often read this blog, I happen to disagree but that's not the point of my comment today. I just wanted to take his code snippet example and comment on it:

<html
 xmlns="http://www.w3.org/2002/06/xhtml2/"
 xmlns:email="http://www.faqs.org/rfcs/rfc2822.html#"
>
  <head>
    <meta property="email:From">John Doe &lt;jdoe@machine.example&gt;</meta>
    <meta property="email:To">Mary Smith &lt;mary@example.net&gt;</meta>
    <meta property="email:Subject">Saying Hello</meta>
    <meta property="email:Date">Fri, 21 Nov 1997 09:55:06-0600</meta>
    <meta property="email:Message-ID">&lt;1234@local.machine.example&gt;</meta>
    <title>An email from John to Mary saying 'hello'</title>
  <head>
  <body>
    This is a message just to say hello.
    So, "Hello".
  <body>
<html>

I can see two design flaws in the simple example above:

  1. We don't need the head and body elements. They are useless. The metadata elements apply to the document. So elements title and meta should just apply to the parent element, and the document itself if the parent element is the root of the document. Samething for the body. An element is a "content container" (if you allow that neologism) or not. We don't need the body. Getting rid of the body will help solving the big problem of "background of the body" vs. "background of the document" vs. "background of the canvas".
  2. Since semantics is the word in everyone's mouth these days, plain text should not be allowed directly inside the body element.

So we should really have here:

<html xmlns="http://www.w3.org/2002/06/xhtml2/"
      xmlns:email="http://www.faqs.org/rfcs/rfc2822.html#">
  <meta property="email:To">Mary Smith &lt;mary@example.net&gt;</meta>
  <meta property="email:Subject">Saying Hello</meta>
  <meta property="email:Date">Fri, 21 Nov 1997 09:55:06-0600</meta>
  <meta property="email:Message-ID">&lt;1234@local.machine.example&gt;</meta>
  <title>An email from John to Mary saying 'hello'</title>
  <p>This is a message just to say hello.
     So, "Hello".</p>
<html>

And I have two extra comments:

  1. this example being about email, the visible line break between the two lines of text in the body would need a <br /> or such to be materialized on the recipient's side.
  2. the original example had an extra erroneous > on the Email:From line. I removed it above.