XSLT - why?
Another in the ‘Why?’ series - I’m looking at methods for delivering a site based on dynamic content - news, clients that sort of thing - and the primary frontend will be a beautifully constructed Flash movie (trust me, it will be beautiful!) but for SEO, accessibility, and general good practice there will be a beautifully constructed xhtml equivalent too.
So how to store and deliver the content? Flash reads xml very well, so it makes sense to pass the content in that format. So how about representing all the content in xml, and use xslt to transform it for html / wap / any other format? Got to be the way to do it!
So I do some research into the practicalities of the approach, and it’s a right palava! Assuming a standard hosting solution, you need the base xml file, the xslt transform file, then something to do the transform. I’m a big PHP fan, but xslt support is not yet bundled (like MySQL for instance) so you’ve got to reconfigure, and that took some doing. Then for every page you need a php script to use the xslt file to transform the xml file. And XPATH and all that jazz takes a bit of getting your head around.
So why not go ‘old skool’ and store the data in MySQL, read it directly using PHP? much easier - oh yes the Flash. That was going to have a bad time extracting meanigful content from a complex structure, so it makes sense to write a ‘translating’ script to prodcue just the data the movie needs in a nice digestable format - another transformation, or another PHP script reading MySQL data.
I know which way is easier, so it leaves one question … why XSLT?








