protected static String nodeToString(Node n, boolean pretty) {
try {
final DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
final DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation("LS");
final LSSerializer writer = impl.createLSSerializer();
writer.getDomConfig().setParameter("xml-declaration", false);
if (pretty) {
writer.getDomConfig().setParameter("format-pretty-print", true);
}
return writer.writeToString(n);
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
Readability.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:openimaj
作者:
评论列表
文章目录