Java XML Transform getTransformer()

Here you can find the source of getTransformer()

Description

get Transformer

License

LGPL

Declaration

static private Transformer getTransformer() 

Method Source Code

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

import javax.xml.transform.OutputKeys;

import javax.xml.transform.Transformer;

import javax.xml.transform.TransformerFactory;

public class Main {
    private static Transformer transformer = null;

    static private Transformer getTransformer() {
        if (transformer == null) {
            try {
                transformer = TransformerFactory.newInstance()
                        .newTransformer();
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
            } catch (Exception e) {
                e.printStackTrace();/* www  .j  a v  a  2s  .  c  o  m*/
                return null;
            }
        }
        return transformer;
    }
}

Related

  1. getThreadedIdentityTransformer(final boolean omitXmlDeclaration)
  2. getThreadedTransformer(final boolean omitXmlDeclaration, final boolean standalone, final Map threadMap, final String xslURL)
  3. getTransformedText(File doc, File xsl, Object[] params)
  4. getTransformer()
  5. getTransformer()
  6. getTransformer()
  7. getTransformer()
  8. getTransformer()
  9. getTransformer()