i am writing a xml, using JDOM2
the customers wish is, to have a line as follows:
<VT xml:space="preserve">20</VT>
but all I can create is:
<VT xml:space="preserve">20</VT>
because the ascii is converted by my format encoding ("ISO-8859-1
")
how to prevent this element from being converted...?
this is, what i use:
String str = "2";
String unescapeXml = StringEscapeUtils.unescapeXml(str);
element.addContent(unescapeXml);
also i use:
format = Format.getPrettyFormat();
format.setEncoding("ISO-8859-1");
format.setExpandEmptyElements(true);
XMLOutputter out;
OutputStreamWriter fw = null;
out = new XMLOutputter();
out.setFormat(format);
try {
fw = new OutputStreamWriter(new FileOutputStream(file));
PrintStream printStream = System.out;
// fw = new FileWriter(file);
out.output(doc, printStream);