Example usage for javax.xml.transform TransformerConfigurationException printStackTrace

List of usage examples for javax.xml.transform TransformerConfigurationException printStackTrace

Introduction

In this page you can find the example usage for javax.xml.transform TransformerConfigurationException printStackTrace.

Prototype

@Override
public void printStackTrace(java.io.PrintStream s) 

Source Link

Document

Print the the trace of methods from where the error originated.

Usage

From source file:com.iflytek.spider.util.DomUtil.java

/**
 * save dom into ouputstream//w w w  .ja v  a  2 s . c o  m
 * 
 * @param os
 * @param e
 */
public static void saveDom(OutputStream os, Element e) {

    DOMSource source = new DOMSource(e);
    TransformerFactory transFactory = TransformerFactory.newInstance();
    Transformer transformer;
    try {
        transformer = transFactory.newTransformer();
        transformer.setOutputProperty("indent", "yes");
        StreamResult result = new StreamResult(os);
        transformer.transform(source, result);
        os.flush();
    } catch (UnsupportedEncodingException e1) {
        e1.printStackTrace(LogUtil.getWarnStream(LOG));
    } catch (IOException e1) {
        e1.printStackTrace(LogUtil.getWarnStream(LOG));
    } catch (TransformerConfigurationException e2) {
        e2.printStackTrace(LogUtil.getWarnStream(LOG));
    } catch (TransformerException ex) {
        ex.printStackTrace(LogUtil.getWarnStream(LOG));
    }
}