XML解析出现An invalid XML character (Unicode: 0x**) was found in the comment.

来源:互联网 发布:linux网络监控工具 编辑:程序博客网 时间:2024/05/20 06:23
      //为了文件中出现0x1e/0x1c等xml无法识别的Unicode字符 ,需要把非法字符替换掉
<span style="white-space:pre"></span>使用如下方法:
          xmlString = xmlString.replaceAll("[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]", "");  
0 0