BF [ 1705883 ] Export translation xml files are not indented

http://sourceforge.net/tracker/index.php?func=detail&aid=1705883&group_id=176962&atid=879332
This commit is contained in:
teo_sarca 2007-04-23 13:37:32 +00:00
parent 66c31c3e63
commit c57ecc59ad
1 changed files with 7 additions and 2 deletions

View File

@ -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)
{