Code example for StreamResult

0
 
        FileReader xmlFileReader = new FileReader(xmlFile);
        StreamSource xmlStreamSource = new StreamSource(xmlFileReader);
 
        FileWriter outFileWriter = new FileWriter(outFile);
        StreamResult outStreamResult = new StreamResult(outFileWriter);
 
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        Transformer transformer = transformerFactory.newTransformer(xslStreamSource);
 
        transformer.transform(xmlStreamSource, outStreamResult);
        outFileWriter.flush();
    } 
 
    public static void main(String[] arguments) {
 
        System.out.println("\n\t#######################################################");
        System.out.println("\t#      Apache Synapse - Configuration Migration       #");
        System.out.println("\t#######################################################");
 
        System.out.println("\n[INFO] Migration STARTED");