From c57ecc59ada9e7d06c65a32072d434630bfa810b Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Mon, 23 Apr 2007 13:37:32 +0000 Subject: [PATCH] BF [ 1705883 ] Export translation xml files are not indented http://sourceforge.net/tracker/index.php?func=detail&aid=1705883&group_id=176962&atid=879332 --- client/src/org/compiere/install/Translation.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/org/compiere/install/Translation.java b/client/src/org/compiere/install/Translation.java index 69db51c542..739827b0f8 100644 --- a/client/src/org/compiere/install/Translation.java +++ b/client/src/org/compiere/install/Translation.java @@ -223,12 +223,17 @@ public class Translation // DOMSource source = new DOMSource(document); TransformerFactory tFactory = TransformerFactory.newInstance(); + tFactory.setAttribute("indent-number", Integer.valueOf(1)); // teo_sarca [ 1705883 ] Transformer transformer = tFactory.newTransformer(); - // Output + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); // teo_sarca [ 1705883 ] + // Output, wrapped with a writer - teo_sarca [ 1705883 ] out.createNewFile(); - StreamResult result = new StreamResult(out); + Writer writer = new OutputStreamWriter(new FileOutputStream(out), "utf-8"); + StreamResult result = new StreamResult(writer); // Transform transformer.transform (source, result); + // Close writer - teo_sarca [ 1705883 ] + writer.close(); } catch (SQLException e) {