Nested exception: The processing instruction target matching "[xX][mM][lL]" is not allowed.

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"?>前面不要有任何其他字符,如空格、回车、换行这些否则就会出现上面的异常。

猜你喜欢

转载自blog.csdn.net/StudyHappiness/article/details/72673360
今日推荐