Here you can find the source of transform(InputStream xslis, InputStream xmlis, OutputStream xmlos)
public static void transform(InputStream xslis, InputStream xmlis, OutputStream xmlos)
//package com.java2s; import java.io.InputStream; import java.io.OutputStream; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; public class Main { public static void transform(InputStream xslis, InputStream xmlis, OutputStream xmlos) { try {/* ww w . ja v a 2s.c o m*/ TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xslis)); transformer.transform(new StreamSource(xmlis), new StreamResult(xmlos)); xslis.close(); xmlis.close(); xmlos.close(); } catch (Exception e) { throw new RuntimeException("Fail to do XSLT transformation", e); } } }