Output doctype
Brought to you by:
wutka
Hi,
recently I needed to output doctype into a produced
XML. I did it as follows:
org.apache.xml.serialize.OutputFormat format =
new org.apache.xml.serialize.OutputFormat
(org.apache.xml.serialize.Method.XML,"UTF-16",true);
format.setDoctype(null,dtduri);
format.setOmitDocumentType(false);
ContentHandler ch=new
org.apache.xml.serialize.XMLSerializer(fileOut, format);
JOXBeanOutput output = new JOXBeanOutput(ch,dtduri);
output.writeObject("doc", msg);
Could it be possible to have as an config option?
Also an option for validation would be nice.