Recently Upgraded the JRE version from 8u241 to 8u261 is breaking my code of writing back dom XML to file. Its removing all the xmlns tags from the xml document.
Below is the code I am 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);
Can someone please help me to fix this issue?