1 2 3 4 5 6 7 8 9 10 11 12 13
| public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
String xmlFile = request.getParameter("fichier");
Source xmlInput = new StreamSource(new File(xmlFile));
Source xsl = new StreamSource(new File("fichxsl.xsl"));
Result xmlOutput = new StreamResult(new File("visualisation.jsp"));
Transformer transformer = TransformerFactory.newInstance().newTransformer(xsl);
transformer.transform(xmlInput, xmlOutput);
} catch (TransformerException e) {
// Handle.
}
} |
Partager