java—将jre版本从8u241升级到8u261是在使用lsserializer写回时从xml文件中删除名称空间(xmlns)标记

cgyqldqp  于 2021-06-27  发布在  Java
关注(0)|答案(0)|浏览(158)

最近将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);

有人能帮我解决这个问题吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题