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

本文介绍了XML文件在解析过程中遇到的头部错误问题及其解决办法。通常这类错误是由于XML文件头部存在空格或回车等非法字符导致。

被折叠的 条评论
为什么被折叠?



