import java.io.File;
import java.io.IOException;
import java.io.Writer;
import java.util.Map;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
public class XmlToExcel {
private static XmlToExcel tplm = null;
private Configuration cfg = null;
private XmlToExcel() {
cfg = new Configuration();
try {
// 注册tmlplate的load路径
// cfg.setClassForTemplateLoading(this.getClass(), "/template/");
cfg.setDirectoryForTemplateLoading(new File("D:/"));
} catch (Exception e) {
}
}
private static Template getTemplate(String name) throws IOException {
if (tplm == null) {
tplm = new XmlToExcel();
}
return tplm