Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File xml = new File(esito.getPath(), esito.getFilename());
- InputStream xsl = Utilities.getXSLEsito(esito);//recupero il foglio di stile in base all'esito
- Source xmlSource = new StreamSource(xml);//esito da mostrare
- Source xslSource = new StreamSource(xsl);
- StreamResult result = new StreamResult(html);
- try {
- TransformerFactory factory = TransformerFactory.newInstance();
- Templates template = factory.newTemplates(xslSource);
- Transformer transformer = template.newTransformer();
- transformer.transform(xmlSource, result);
- dh = new DataHandler(new FileDataSource(html));
- } catch (TransformerException ex) {
- return new DataHandler(new FileDataSource(xml));
- } finally {
- xsl.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement