且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java 解析 XML 文档给出“Prolog 中不允许的内容".错误

更新时间:2023-11-06 19:29:10

请检查xml文件是否有这样的垃圾字符.如果存在,请使用以下语法删除.

Please check the xml file whether it has any junk character like this �.If exists,please use the following syntax to remove that.

String XString = writer.toString();
XString = XString.replaceAll("[^\x20-\x7e]", "");