Commit 2f8eb8c8 authored by litengwei's avatar litengwei

Merge remote-tracking branch 'origin/develop_dl_bugfix' into develop_dl_bugfix

parents 43543c34 71c7481d
...@@ -192,30 +192,5 @@ public class WordHtml implements AbstractHtml { ...@@ -192,30 +192,5 @@ public class WordHtml implements AbstractHtml {
} }
} }
} }
public static void xml2Ttml(String docPath, String xsltPath, String hrmlPath) {
try (
//创建XML的文件输入流
FileInputStream fis = new FileInputStream(org.apache.commons.io.FilenameUtils.normalize(docPath));
//创建XSL文件的输入流
FileInputStream fis1 = new FileInputStream(FilenameUtils.normalize(xsltPath));
PrintStream stm = new PrintStream(hrmlPath);
) {
Source source = new StreamSource(fis);
Source template = new StreamSource(fis1);
//讲转换后的结果输出到 stm 中即 F:\123.html
Result result = new StreamResult(stm);
//根据XSL文件创建准个转换对象
TransformerFactory transformerFactory = TransformerFactory.newInstance();
transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
Transformer transformer = transformerFactory.newTransformer(template);
//处理xml进行交换
transformer.transform(source, result);
} catch (TransformerException | IOException e) {
e.printStackTrace();
}
}
} }
...@@ -191,30 +191,5 @@ public class WordHtml implements AbstractHtml { ...@@ -191,30 +191,5 @@ public class WordHtml implements AbstractHtml {
} }
} }
public static void xml2Ttml(String docPath, String xsltPath, String hrmlPath) {
try (
//创建XML的文件输入流
FileInputStream fis = new FileInputStream(FilenameUtils.normalize(docPath));
//创建XSL文件的输入流
FileInputStream fis1 = new FileInputStream(FilenameUtils.normalize(xsltPath));
PrintStream stm = new PrintStream(hrmlPath);
) {
Source source = new StreamSource(fis);
Source template = new StreamSource(fis1);
//讲转换后的结果输出到 stm 中即 F:\123.html
Result result = new StreamResult(stm);
//根据XSL文件创建准个转换对象
TransformerFactory transformerFactory = TransformerFactory.newInstance();
transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
Transformer transformer = transformerFactory.newTransformer(template);
//处理xml进行交换
transformer.transform(source, result);
} catch (TransformerException | IOException e) {
e.printStackTrace();
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment