public static void transform ( final Source input , final Source sheet , final Result output ) { try { final DOMResult intermediate = new DOMResult ( createEmptyDocument ( ) ) ; // Transform. createTransformer ( sheet ) . transform ( input , intermediate ) ; // Format. format ( new DOMSource ( intermediate . getNode ( ) ) , output ) ; } catch ( final Exception ex ) { LOGGER . error ( "Problem transforming XML file." , ex ) ; } }
Transform an XML document according to an XSL style sheet .