Hung Truong: The Blog!

Checkin’ Out XSLT

January 26, 2009 | 1 Minute Read

So at work, I’m trying to figure out a good way to make some web pages extensible and also extremely easy to edit. Basically, the people in charge need to be able to make new pages and edit the existing ones when I leave. I was trying to figure out how to do this without a CMS. Because I can’t just throw a CMS into the web server.

I have a friend who wrote something for his portfolio that involves making an xml file, then using the xml to make an HTML page. I was curious to see if this was some kind of common paradigm, and if so, if there were frameworks I could use. The ideal situation would be if I could just set up some XML schema for people to fill in content and then somehow create the HTML from that. Then whoever was updating it would just update the XML (which would be fairly easy since they wouldn’t worry about markup, just the data).

I came across another old friend’s framework, Onion ML, while searching for a solution. It’s pretty funny that I went to undergrad with this guy but just found his site by looking up my own keywords. The Onion ML thing led me to XSLT, which seems to be the solution to my problem.

Apparently XSLT is a way to transform XML into HTML (or something else that’s useful). Unfortunately, XSLT seems a bit more complicated than I was hoping. It looks like the style is defined in one file, then the XML is in another, then there needs to be a way to smash the two together (at running time). I guess there are ways to do this using javascript but I haven’t gotten that far yet.

So what’s the point of this post? I dunno. Probably just to document my thought process on how I got this far. Next step is to see if XSLT can make the job easier or make it needlessly complex (it seems to be a technology that was popular in the early 2000’s, if all these Google searches are correct).