mahiwaga

I'm not really all that mysterious

blosxom and XSLT

My dream (heh, that sounds really bizarre and grandiose but there it is) is to write a blogging engine that is centered around entries written in a custom XML language and transforming it to XHTML and RSS via XSLT. The only real reason I’d like to do this is because I spent an awful amount of time learning XML and XSLT back in the day and I think it would let me do things that I otherwise am not able to do easily without massive amounts of perl kludgery.

Eventually I built a kludgy blog engine that rendered only static pages using perl scripts and Makefiles (which was not a big deal since I didn’t have access to CGI on my ISP webspace anyway.) Then I moved to a real webhost, and figured I might as well try to get my money’s worth.

To that end, I succeeded in welding on comments using an existing perl script written by Phil Ringnalda (despite the fact that my webhost does support PHP, except that I didn’t want to mix scripting languages), but eventually I abandoned my homebrew and went with blosxom.

But the idea of writing entries in valid XML (that is, being able to use existing tools to check syntax) still stuck with me, except I couldn’t figure out how to write a plugin to do it.

So I had another look at the annotated version of Blosxom 2.0 and I think I figured out which lines actually read the entries (lines 366-372):

     
     use vars qw/ $title $body $raw /;
     if (-f "$path_file" && $fh->open("< $path_file")) {
          chomp($title = <$fh>);
          chomp($body = join '', <$fh>);
          $fh->close;
          $raw = "$titlen$body";
     }

At this point I imagine I would insert some XML-parsing code to grab the title and this would suffice to allow me to use a custom format for my entries.

But to go further, in order to use XSLT to do the templating, I’d probably have to write a plugin to intercept interpolation and what-not, but that is probably getting ahead of myself.

Kevin Scaldeferri, who is now maintaining Blosxom 2, has an unpublished plugin that allows you to write entries in XHTML, so it would probably be good to see his code before I simply hack the base code of Blosxom.

initially published online on:
page regenerated on: