Hi!
I am using local xsl files to transform xml documents into html.
I wanted to cache those xsl files, because they are used often in my application and usually stay the same. The xsl files also use xsl:import. I looked in the API documentation and found the setURIResolver method
for
TransformerFactory and Transformer classes. So I made my own URIResolver and used them in the setURIResolver. URI xsl = new File(xslFile).toURI();
Transformer transformer = tFactory.newTransformer(new StreamSource(xsl.toString())); CachingURIResolver resolver = new CachingURIResolver(); tFactory.setURIResolver(resolver); transformer.setURIResolver(resolver); ... transformer.transform(... Unfortunately the resolve method of my CachingURIResolver is never
called!
The transformation is done normally.
I am using Xerces-j_2_6_2 and Xalan-j_2_6_0.
How can I get this to work correctly? Or is there an easier way to
accomplish my goals?
Thanks for any help. Robert. |