Menu

#7 Output doctype

open
nobody
None
5
2004-08-23
2004-08-23
Antti Lehto
No

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.

Discussion


Log in to post a comment.

Monday.com Logo