use of javax.xml.transform.sax.TransformerHandler in project tika by apache.
the class TikaGUI method getXmlContentHandler.
private ContentHandler getXmlContentHandler(Writer writer) throws TransformerConfigurationException {
SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
TransformerHandler handler = factory.newTransformerHandler();
handler.getTransformer().setOutputProperty(OutputKeys.METHOD, "xml");
handler.setResult(new StreamResult(writer));
return handler;
}
Aggregations