Anne van Kesteren

Atom example

Web Forms 2.0 in IE expressed in draft-ietf-atompub-format-08:

<feed xmlns="" xml:base="">
 <title>Anne’s Weblog about Markup &amp; Style</title> 
 <link href=""/>
  <name>Anne van Kesteren</name>
  <title type="html">Web Forms 2.0 in &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;</title>
  <link href="/archives/2005/05/web-forms-2"/>
  <summary>The implementation of Web Forms 2.0 in Internet Explorer has started.</summary>

Instead of using type="html" I could have used type="xhtml". For comparison, that would look like this:

<title type="xhtml">
 <div xmlns="">
  Web Forms 2.0 in <abbr title="Internet Explorer">IE</abbr>

Dropping the DIV element here is impossible as Atom requires a DIV element in XHTML constructs. I believe it is for interoperability, but even with this DIV element I can make it totally unsafe for copy and paste:

<foo:title type="xhtml">
  <bar:abbr title="Extensible Markup Language">XML</bar:abbr>

Where the foo prefix is bound to the Atom namespace (I guess that will look like and div and bar are bound to the namespace. Fun!

The good thing of Atom is that everything is defined. I don’t have to guess how things work and I don’t have to worry about data loss. Before I get e-mails from Atom zealots: it is indeed possible to represent a single entry in an atom:entry root element. I’m just demonstrating how a feed looks like. That there can be more entries in a feed is something I hope that’s obvious.