Six Apart News & Events

Atom Specs and Test Suites

A very important piece of the Atom API and syndication format is that it is--or will be--a fully-specified format, complete with test suites and sample implementations. The atom-syntax list, and Mark Pilgrim in particular, have been doing a lot of good work building specs, and I've updated XML::Atom to reflect some of those changes.

No piece is too small to be overlooked. A couple of weeks ago, Mark published a suite of feed auto-discovery tests, along with an Atom feed autodiscovery RFC, documentation about the syntax and semantics of the <link> tag and the process of constructing absolute URIs from relative URIs.

I've released version 0.05 of XML::Atom, which among other things includes fixes to feed autodiscovery so that XML::Atom::Feed now passes all of Mark's tests. I didn't include the test script in the distribution, because I didn't want Mark's server to get hammered by people automatically running the test suite. But you can download it here.

Another item included in this new version of XML::Atom is a server implementation of the API. XML::Atom::Server implements a core base system upon which other implementations can build and hook into their own applications. It runs under either mod_perl or CGI, it transparently handles both the SOAP and REST versions of the wire format, and it performs UsernameToken WSSE authentication. Here's some sample usage:


package My::Server;
use base qw( XML::Atom::Server );
sub handle_request {
    my $server = shift;
    $server->authenticate or return;
    my $method = $app->request_method;
    if ($method eq 'POST') {
        return $server->new_post;
    }
    ...
}

Comments