Citation :
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes" );
//Creation de l'arbre DOM
Source source = new DOMSource(machinToDocument(documentBuilder, numeroMachin, date, machinForm, contexte));
URL urlw = new URL("http://repertoire/fichier/machin/" );
HttpURLConnection conw = (HttpURLConnection)urlw.openConnection();
conw.setDoOutput(true);
conw.connect();
OutputStream outc = conw.getOutputStream();
Result result = new StreamResult(outc);
transformer.transform(source, result);
outc.close();
outc.flush();
|