首页 > 学院 > 开发设计 > 正文

XML or text declaration not at start of entity异常的原因

2019-11-09 18:51:32
字体:
来源:转载
供稿:网友

今天在做xml解析的时候,总是给我报

XML Parsing Error: XML or text declaration not at start of entity

 

的错误,后来查了下讲意思是android中解析的时候xml文件格式问题。

 xml文件要以一下作为开始,不能有空格或者回车等的符号。

在文件的最前端 即<?xml version="1.0" encoding="UTF-8"?>前面不能有空格。

 

修改即好。

参考 http://hellorheaven.iteye.com/blog/846005;

 


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表