posted 20 years ago
I am using the SDK JAXP implementation of DOM to parse a simple XML document containing a !DOCTYPE tag, make a minor modification and write it back to a file. All works fine except that the !DOCTYPE tag is not written to the StreamResult by the Transformer.
getDoctype() on the Document does return a Doctype object that was parsed, but it's not written when transforming the Document into a StreamResult.
How do I write the !DOCTYPE tag into the output?
Please help.
Nikhil