我使用 XMLOutputter 编写 xml 文件以在 android 中使用它。写入文件时,字符串
<string name="sname"><u>Text</u></string>
写成
<string name="sname"><u>Text<u></string>
我从数据库中读取“<u>Text<u>”,然后将其放入 jdom 文档中。然后我使用
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
Writer writer = new OutputStreamWriter(new FileOutputStream(file), "utf-8");
outputter.output(doc, writer);
writer.close();
如何防止转义并将确切的字符串从数据库放入文件?(我想要'<',不在<
那里)