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

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:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章