Created
July 7, 2011 11:40
-
-
Save theresajayne/1069338 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public File generateFOFromXml(File xslFile,File xmlFile){ | |
File tempout = null; | |
try { | |
TransformerFactory tFactory = TransformerFactory.newInstance(); | |
Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile)); | |
tempout = File.createTempFile("tmp", ".fo"); | |
transformer.transform(new StreamSource(xmlFile), new StreamResult(new FileOutputStream(tempout))); | |
} catch (TransformerConfigurationException tce) { | |
LOGGER.error("Transformer Configuration Error",tce); | |
} catch (IOException ioe) { | |
LOGGER.error(ioe); | |
} catch (TransformerException te) { | |
LOGGER.error(te); | |
} | |
return tempout; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment