最近将jre版本从8u241升级到8u261打破了我将domxml写回文件的代码。它将从xml文档中删除所有xmlns标记。
下面是我的密码using:-
final DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
final DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation("LS");
final LSSerializer writer = impl.createLSSerializer();
writer.getDomConfig().setParameter("format-pretty-print", Boolean.TRUE);
final LSOutput output = impl.createLSOutput();
output.setByteStream(out);
writer.write(document, output);
有人能帮我解决这个问题吗?
暂无答案!
目前还没有任何答案,快来回答吧!