public Document transXmlToHtml(String xmlFile, String xsltFile) throws Exception{
Document doc;
System.setProperty("javax.xml.transform.TransformerFactory", "org.apache.xalan.processor.TransformerFactoryImpl");
Source xmlSource = new StreamSource(new File(xmlFile));
Source xsltSource = new StreamSource(xsltFile);
TransformerFactory transFact = new net.sf.saxon.TransformerFactoryImpl();
DocumentResult result = new DocumentResult();
Transformer trans = transFact.newTransformer(xsltSource);
trans.transform(xmlSource, result);
doc = result.getDocument();
// Element root = doc.getRootElement();
// generateHtmlId(root, null);
//处理xslt转换xml后的表格
// doc = result.getDocument();
// String content = doc.asXML();
// content = content.replaceAll("<(.*?) (.*?)/>","<$1 $2> </$1>");
// .replaceAll("<(.*?)/>","<$1> </$1>");
//doc = XmlUtilDom4j.parseXmlByString(content);
return doc;
}