throw new RenderingException(e);
}
}
private Template findTemplate(final String templateName) throws SAXException, ParserConfigurationException, ClassNotFoundException, IOException {
TemplateEngine ste = templateName.endsWith(".gxml") ? new XmlTemplateEngine() : new SimpleTemplateEngine();
File sourceTemplate = new File(templatesPath, templateName);
Template template = cachedTemplates.get(templateName);
if (template == null) {
template = ste.createTemplate(new InputStreamReader(new BufferedInputStream(new FileInputStream(sourceTemplate)), config.getString(Keys.TEMPLATE_ENCODING)));
cachedTemplates.put(templateName, template);