An invalid XML character (Unicode: 0x5) was found in the element content of the document.


在解析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]", "");

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM