Thursday, May 21, 2009

XSLT caching Transformers

 The usage of cached transformer objects is recommended here

A sample implementation of CachingTransformerFactory is here

The above code abstracts the caching of Transformer objects using HashMap's.

In brief it says to override the TransformerFactoryImpl and cache the transformer objects. The xsl updates are dealt by checking the timestamp on the XSL file.
Hence no need of a web service to update XSL transformer cache!!

Using TransformerFactory.newInstance() ,
there will be absolutely no code change. The Services API will look for a classname in the file META-INF/services/javax.xml.transform.TransformerFactory in jars available to the runtime. More here...






No comments: