24 ways to impress your friends

24 ways to impress your friends site

So I've been pretty quiet about 24ways to impress your friends this year. The reason why is because I've been writing a tip titled Making XML beautiful again to go into the 24ways collection for 2006. The tip centres around a client side XSL transformation on a ATOM feed. I thought this would be simplier that RSS because I would have to create templates to support RSS 0.91, 0.92, 1.0 and 2.0. ATOM 1.0 feeds are also very much a like so a safe ground to start on (although a lot of ATOM 0.3 feeds use a different date element).

The actual XSL took me all of about 5mins to write but the explaining took a good few weeks. I have spell checked it, grammer checked and run it past the eyes of Sheila (my XSL friend). Sheila helped a lot on making it sound less like me talking and more like me writing, but there is still bits of my twisted humour in there. I also wanted to explain the difference between client-side and server-side transformations but decided it was out of scope. As was spending 3 paragraphs on what XSL is, which I finally cut down to 1. There is also something else which has been bugging me while writing the tip. Firefox 2.0, I can not work out if its actually broken when it comes to client side transformations or not. Some people seem to think so, but I'm getting just odd results like the output escaping not working. I've tried to install Firefox 1.5 in a Virtual Machine but I can't get it online (for many reasons). So I'm currently loading up a old Ubuntu Boot CD on a spare machine. I'm sure the comments will come flooding in soon.

Anyway big thanks to Drew McLellan for thinking about me when relaunching the 24ways project this year. Maybe Drew took it to heart when (in a good way of course) I asked why he didn't use XSL for parsing Microformats at BarCampLondon. I was still amazed he used a non rules based language to parse Microformats. It shows talent. Thanks again Drew, I just hope it comes across as well, as the other excellent authors on 24ways..

Comments [Comments]
Trackbacks [0]

A XSL transformation mindset

Someone asks on Metafilter.

When you imagine XSLT transformations happening in your mind's eye, what does it look like?

Its a really good question and opens up a whole range of thinking about the differences in peoples thought processes. So first Jeff talks about the question.

This is a very powerful question to ask, because ancient, procedurally oriented developers like me sometimes have trouble following the non-linear, pattern-driven processing that takes place when an XSLT template is applied to a tree of XML elements. In fact I have noticed that non-developers sometimes have an easier time with XSLT than do experienced developers, because they don't try as hard to figure out what is happening beneath the covers.

I would kind of agree with that statement. Theres something about XSL and XML which just makes sense in my head. I'm not from a traditional software or computer science background, so I still find it weird to be called a programmer by some of my peers. John wrote this fantastic comment.

My first project with XSLT a few years back was to actually generate XSLT *from* XML and XSLT and forced me to break my ideas of how it worked. When I finally got the whole “it happens all at once” approach, it started to make sense. However, every programmer that I've brought on board to an XSLT project since has had trouble getting out of the procedural thinking and that ends up being the biggest source for their mistakes.

Unfortunately, like MagicEye images, some people just aren't able to unfocus their minds in the right way to really grok XSLT beyond the simplest examples.

I have heard of programmers comparing XSLT to Prolog and even Lisp, I'm not sure how true this is but its certain that you can't approch XSLT in a regular way. Recursion is one of those things which seems to drive people mad. In XSL there's a lot of recursion and declaration which seems to fit the way I think. I always wanted to create a SVG of a XSLT process. So you can see in lines and boxes what templates are being called and add some kind of dimension to XSL. I'm sure its not that hard and even my experiements with transforming Cocoon's Sitemap file into SVG didn't require too much work. Talking about recursion someone posted this nice animated gif of how it all works. There's no douht that XSL requires a different mindset and working with a programming language like Java or Perl will be more of a hinderance that an advantage.

I posted this question to a few of the XSL developers I know and got a variaty of answers. In my own mind I see lots of lines and trees which get broken into branches

Comments [Comments]
Trackbacks [0]