xml文件不能被解析

来源:互联网 发布:qq群倍投软件 编辑:程序博客网 时间:2024/04/30 08:44

现象:

ERROR  - Error on line 2 of document  : The processing instruction target matching "[xX][mM][lL]" is not allowed. Nested exception: The processing instruction target matching "[xX][mM][lL]" is not allowed.

异常解释:xml文件不能被解析,一般出现这样的问题在于xml格式上,并且问题多出现在xml文件的头部。

原因:一般多是因为xml文件头部有了空格或回车导致的

总结:<?xml version="1.0" encoding="UTF-8"?>前面不要有任何其他字符,如空格、回车、换行这些否则就会出现上面的异常。

0 0