posted on Sunday, April 17, 2005 7:29 PM by kevdaly

Fooling around with the Atom API

I've been familiarising myself a bit with Atom lately, developing some code to use the Atom API with Blogger (yeah I know it's been done and done well, but it's all about learning how things work).
My objective is to create a C# wrapper for the API, produce one or more simple Blogger clients that use it (this time I was thinking of maybe one each for Windows, Pocket PC and Smartphone 2003), and make the source available for download so people can use it to spark their own ideas and hopefully come up with something useful and pretty.
I'd ideally like to be able to target other Atom-powered tools such as TypePad and so on, although the diversity of implementations is daunting (not just authentication: even fundamental things such as whether embedded markup is escaped. It's fair to say that on most of these issues it's Blogger on one side, everybody else on the other).

So anyway, things have been steaming along quite nicely and I have PUT, POST, GET and DELETE methods all working (we're so lucky compared with our poor J2ME brethren).
However, one little glitch is driving me crackers: Every time I create a post, the <content> tag has an extra <div> added to it (in addition to but exactly identical to the one that I am putting there myself). This is both puzzling and very annoying.

For instance, here's what I send:

<content type="application/xhtml+xml">
<div xmlns="http://www.w3.org/1999/xhtml">Yet more fooling around with Atom. Actually, I've just spent my Sunday afternoon and evening at work, so I should probably give up for now and go to bed.</div>
</content>

And here's what comes back:

<content type="application/xhtml+xml" xml:base="http://kevindaly.blogspot.com" xml:space="preserve">
<div xmlns="http://www.w3.org/1999/xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Yet more fooling around with Atom. Actually, I've just spent my Sunday afternoon and evening at work, so I should probably give up for now and go to bed.</div></div>
</content>

It's a mystery to me.

Comments