[Solved] Dom4j parsing XML file error: invalid XML character (Unicode: 0x8)

Errors are reported as follows:

org.dom4j.DocumentException: Error on line 9862 of document  : Invalid XML characters found in the CDATA section (Unicode: 0x8)

Enter the 9862 line of the XML document, delete the characters similar to spaces one by one, and test them one by one. When a space is deleted, this line will not report an error, and then copy the characters similar to spaces (0x8) for global search and replacement. Replace all 0x8 with common spaces, and then do not report the error.

Then the following error is reported:

org.dom4j.DocumentException: Error on line 60679 of document  : The tags following the root element in the document must be properly formatted.

This is relatively simple because I deleted < at the beginning of the XML document; rss> tag, but </ rss> forgot to delete.

Similar Posts: