Java XML Transform newTransformerHandler()

Here you can find the source of newTransformerHandler()

Description

new Transformer Handler

License

Apache License

Declaration

public static TransformerHandler newTransformerHandler() throws TransformerConfigurationException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.xml.transform.TransformerConfigurationException;

import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;

public class Main {
    private static SAXTransformerFactory transformerFactory;

    public static TransformerHandler newTransformerHandler() throws TransformerConfigurationException {
        if (transformerFactory == null) {
            transformerFactory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
        }//from  w ww  .j  av  a2s  .  c om

        return transformerFactory.newTransformerHandler();
    }
}

Related

  1. newTransformer(int indent)
  2. newTransformerFactory()
  3. newTransformerFactory()
  4. newTransformerFactory()
  5. newTransformerHandler()
  6. newTransformerHandler(final SAXTransformerFactory tf)
  7. serializeXML(Transformer transformer, Source input)
  8. transform(byte[] doc, URL xsltUrl, OutputStream out)
  9. transform(byte[] source, InputStream xslInputStream, File output)