Detailed explanation of how to handle the 'Content is not allowed in the preface' error when reading an XML file

黄舟
Release: 2017-03-30 14:20:42
Original
7595 people have browsed it

When I use the jstl tag to read theXMLfile, I always get the error "Content is not allowed in the preface". After checking, the XML file format and content are correct. After searching on Baidu, I found out that it was a file encoding problem.

Use Notepad to open the xml file and convert it to UTF-8. There will be a BOM header, so java will report the above error when reading.

Solution: Open it with notepad++, select "Encode in UTF-8 BOM-free format" in the format, and then save it. You can also use EmEditor to save as a file, and select "UTF-8 No Signature" when saving.

The above is the detailed content of Detailed explanation of how to handle the 'Content is not allowed in the preface' error when reading an XML file. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!