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!
How to solve 0xc000409 error
How to solve the WerFault.exe application error
How to convert pdf to xml format
The difference between heap and stack
What are the parameters of marquee?
What is the difference between Douyin and Douyin Express Edition?
What is a servo motor
What are the marquee parameters?