Ionrock Dot Org

by Eric Larson

My Weblog

New XSLTemplates

In playing around with some projects I have made quite a few updates to XSLTemplates. Here is a quick rundown of things that were added:

  1. Setting the template via a module url - You can use "pkg://module.to.import#path/to/file.xslt" to use XSLTs that are included in an egg.
  2. Resolver includes a package prefix - You can use the "pkg:" prefix with a "module#path/to/package/file.xslt" wherever the resolver is used.
  3. Default index file middleware - I found that sometimes the template is really just for substitution purposes and that you really aren't matching on anything. So, this allows you to set your own default XML file that will be sent to the processor in the case of an empty response body.
  4. Set/Get functions for setting the template and parameters - This lets you simply do set_params(environ, dict_of_parameters) to update/create the parameters for the template and set_template(environ, template_name) to set the template.

Nothing too major but it makes life a great deal easier. I also hopefully will get around to making compiled transforms via eggs so you could simply include it and hopefully get a slightly faster transform. I've yet to hit any performance issues, but it seems like a nice feature for deployment purposes.

Posted Thu Nov 8 20:46:02 2007 by Eric Larson
Created using Python, jQuery and Emacs