torchbox logo CFX_TransletWrapper - using compiled Xalan stylesheets in ColdFusion applications


I wrote this custom tag to enable the fastest possible XSLT transformations in our ColdFusion applications. It uses a technology - originated by Sun Microsystems and donated to the Apache Software Foundation - known as 'Translets' or compiled stylesheets ('XSLTC'). Using the free XSLTC tools from xml.apache.org XML developers can compile XSLT stylesheets into lightweight, portable Java classes, enabling impressive performance improvements over traditional transformation techniques. This tag provides a ColdFusion wrapper to the poorly documented procedures required to call Translets. The tag is written in Java, allowing cross-platform integration.

Installation of the tag is rather more complicated than usual, as you'll have to compile your own Translet(s) and add this to ColdFusion's class path as well as the other necessary classes. If you're hosting on a shared server, it's very unlikely that you'll be able to persuade the support people to do all this for you! However, if you have your own server, and your application demands high performance transformations of XML documents on a standard XSL stylesheet, the extra effort should be worthwhile. Moreover, it's the only free, open-source CFX tag that I know of for XSL transformations.

Full source code, installation instructions and usage examples are included in the download. For a background to Translets, and information on how to compile them, see http://xml.apache.org/xalan-j/xsltc_usage.html.

<cfx_transletwrapper
   xml = "http://torchbox.com/xml/test.xml"
   translet = "SimpleTranslet"
   result = "transformed">

<cfoutput>#transformed#</cfoutput>

Click here to download the tag.

For support and discussion, sign up to the cf-xml mailing list.

CFX_TransletWrapper was developed by me, Tom Dyson of Torchbox, with help from my colleagues Helen Warren and David Maddison.