Here you can find the source of getTransformer(final InputStream xsl)
private static Transformer getTransformer(final InputStream xsl) throws TransformerConfigurationException
//package com.java2s; //License from project: Educational Community License import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamSource; import java.io.InputStream; public class Main { private static Transformer getTransformer(final InputStream xsl) throws TransformerConfigurationException { return TransformerFactory.newInstance().newTransformer(new StreamSource(xsl)); }/* w w w. ja v a2 s . c o m*/ }