在解析XML文件时:

org.dom4j.DocumentException: Error on line 1 of document : An invalid XML character (Unicode: 0x5) was found in the element content of the document. Nested exception: An invalid XML character (Unicode: 0x5) was found in the element content of the document.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:278)

解决方法:

content = content.replaceAll("[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]", "");

 

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
猜你喜欢
  • 2022-12-23
  • 2021-11-16
  • 2021-04-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案