Ionrock Dot Org

by Eric Larson

My Weblog

AtomPub Hacking

Recently the Atom Publishing Protocol was blessed as an IETF standard. I have been personally working on an AtomPub implementation for Bright Content while playing around with Amplee here and there. One thing I realize regarding Atom and generally working with XML is that an understanding of all the different XML technologies is critical in order to get the most value.

Take for example updating an Atom entry. One thing that I constantly run into is recursively copying nodes. This is a breeze with XSLT, which is why I started processing updates through a stylesheet. The issue I found there was simply organizing my stylesheets within the context of my application. In the end I think I changed the design to simply just use Amara, but there was a definite path for building Python and XSLT based apps using distutils, which is really exciting.

Where this connection between XSLT and Python can get tricky is in the case where external sources are referenced. In my AtomPub client, I was getting service documents directly within the XSLT by wrapping httplib2 and creating a node-set from the GET results. I ended up changing this because it was more forgiving to get the service document in Python and grab any collections. This revealed a slight disjoint, but in the end it worked out since most of the code could still use the same match templates.

I think navigating these differences between models and taking advantage of each language’s strength simply takes time and practice. It can be hard to see where you might want to do something with XSLT when you have to think about resolving stylesheet links and everything else, so possibly the answer to making the whole thing work is finding a good way to easy apply an XSLT to XML. The Amara xml_xslt method is a good start but something more robust might be beneficial. Something to think about…

Posted Tue Aug 7 17:45:00 2007 by Eric Larson
using python, jquery and emacs ;)