transformer.setOutputProperty(
javax.xml.transform.OutputKeys.ENCODING,
CharacterSet.ISO_8859_1.getName());
}
DocumentType docType = getDocument().getDoctype();
if (docType != null) {
if (docType.getSystemId() != null) {
transformer.setOutputProperty(
javax.xml.transform.OutputKeys.DOCTYPE_SYSTEM,
getDocument().getDoctype().getSystemId());
}
if (docType.getPublicId() != null) {
transformer.setOutputProperty(
javax.xml.transform.OutputKeys.DOCTYPE_PUBLIC,
getDocument().getDoctype().getPublicId());
}
}