out = new FileOutputStream(f);
String outDTD = config.getOutputDTD();
// This loads the DoNohtingTransformer.
TransformProcessor transformer = new DoNothingTransformer();
//TransformProcessor.getInstance(
// inDTD, outDTD);
ByteArrayOutputStream bout = new ByteArrayOutputStream(2048);
ParserContext handler = new ParserContext();
ParserListener listener = new DTDXmlParserListener(bout,
outDTD == null ? null : Config.getInstance()
.getXMLBaseURL()
+ "/" + outDTD);
handler.addListener(listener);
adapter.adapt(file, handler);
transformer.transform(new ByteArrayInputStream(bout.toByteArray()),
out);
} finally {
if (out != null) {
out.close();
}