Resolve the “XML parser error on line 1: content not allowed in preface” error

When publishing a project with eclipse, if you edit the XML file in the project with the Notepad provided by windows and save it for operation, an error will be reported:

I only knew this problem before, but I don't know the reason. I can only edit it in eclipse and paste it. Today, I encountered this problem again. After studying the characteristics, I found that it is only necessary to save the file code as ANSI when saving the file. However, some students said that saving as ANSI still can't solve the problem, If you have the above problems, you can try to open the XML file with Notepad + +, find the encoding menu in the menu bar, select "encoding in UTF-8 no BOM format", and then save it

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>