"xsl" in Weblog

(ux + ui + product) * (design + hacking)

XSL Comes to DNR

9 January 2005 · web development · xsl

I’m back from an unplugged Christmas and New Year, which was much needed after a ridiculous week of work leading up to Christmas Eve. I’ve hardly read any blogs and the number of emails I’ve answered could be counted on one hand. Great.

I’ve spend the last couple of days updating the work section of my website though, in preparation for the new year. It’s been ages since I added any new work and the amount I’ve got in there now required a rethink. It could still do with a bit of design TLC but I don’t think I’m going to have time for a few weeks. Anyway, I thought I’d take the opportunity to flex my brand new XSL muscles, especialy since I’ve got a little side-project on the subject coming up. I’ve been meaning to rewrite my whole site in PHP/MySQL and separating the content from the style (in-joke) with an XML layer (plus a little bit of custom caching) seemed like the best way.

My site is hosted by dc-hosting and provides IIS servers but with PHP/MySQL support built in. Ideal! It means that I can recode the front end with XSL and all I need to do when I move to PHP is write some simple XML generation scripts and I’m away.

I’ve got that big red and yellow XSLT 2nd edition book but the most useful resource for this little project has been the PDF version of Essential XML Quick Reference. A physical book is great but for reference the most useful thing is fast searching and nothing beats electronic data for that. And it’s free! Go get it. Now. Before they change their minds.

I had my first real brush with XML and XSLT transormations last week and I am very very impressed. The CMS I’m working with generates XML transformed with XSLT to spit out the navigation elements so I had to give myself a crash course in what it was all about. I still don’t entirely understand the syntax but I can get basic things done thanks to the wonders of the web community.

I started with the W3C Schools’ XSLT Tutorial, with a quick detour through their XPath Tutorial and finished with a handy article from Pascal called XSL: the other way of styling up content. Nice one mate! An hour or so later I was writing my first piece of XSL…

So far I like XSL enough to consider sacking off my planned site migration to TextPattern and instead rewrite it as XML-XSL-CSS… The further separation of style and content just makes sense. Why embed your layout into your ASP/PHP logic? I could redesign my site comepletely and not have to touch the back-end code - I’d just tweak the XSLT and CSS. Now that appeals to me.

Page 1 of 1

Getting around