Apache2 XSLT

October 28th, 2007

I'm trying out the libapache2-modxslt module which is written in c an provides the ability to parse XML. :-)

I just installed it on an ubuntu machine and am going to follow their instructions when trying it out for the first time.

sudo apt-get install libapache2-modxslt

sudo a2enmod modxslt

I had difficulty with their documentation, but I was able to figure out the basics. Here's what I used in my config:

            Order deny,allow        Deny from all        Allow from 192.168        SetOutputFilter mod-xslt        AddType text/xml .xml        XSLTSetStylesheet text/xml /var/www/public/test.xsl    




     XSLT Test

In my test, Apache cached the XSL file even though a reboot and modification time change. Hmmm.

Also, documents produced by modxslt generate this comment at the end of the document which is pretty cheesy:

That copyright message has no business being in a resulting document created by someone else. I'm surprised that Debian let something like that slip through. Blah.

I was just sifting through the code and found this:

That is even lamer that they are aware that people don't want it there but make it difficult to remove. Shame shame. At least its GPL so someone (me?) can fork it and remove that lameness.

After going through this, I frankly don't see the point of such a module anyway. If you are going to have XML and XSL docs transformed on the server, might as well render them to the desired static output. If you are going to do dynamic transformations based upon user input, why not use PHP? Apache isn't designed to handle complex logic, so if you pass that off to something like PHP, why not do the same with the transformations? Also, I think with javascript libs iike sarissa and goog-ajaxslt, offloading the transformations to client browsers will get much easier. For simple stuff, most modern browsers can do the XSL transformations themselves.

In my humble opinion, it would make more sense to have Apache test for browser user agents, and pre-render the content when serving requests to older browsers.


Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022