android read xml error: not well-formed (invalid token)

来源:互联网 发布:灰度图像质心快速算法 编辑:程序博客网 时间:2024/05/22 06:20

when used android to read local XML file, it show show up error:

 

org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: not well-formed (invalid token)

 

 

while, the xml file is located at res/xml/myfile.xml

 

then the solution is that, change the file path, put the xml file under res/raw

so the xml file now is located at res/raw/myfile.xml

 

now the program read the file run smoothly.

 

here is my code: