xml - Android SAXParser : Not well-formed document ... That *do* is well-formed -



xml - Android SAXParser : Not well-formed document ... That *do* is well-formed -

so, have launcher activity, user selects file (in fact, directory, containing .xml , .wav).

when clic on file wants open, start new activity works selected files.

display files user launcher_activity : onclick : other_activity.path_dir = file.getabsolutepath(); startactivity(other_activity_intent); other_activity : file_source = new inputsource(new stringreader( path_dir + "/xml.xml" )); parser.parse(file_source)

parseexception : @ line 1, column0: not well-formed (invalid token)

it's xml file empty ... but, know path_dir right one, , xml file @ right place also

i know well-formed because using before. in previous version of app, .xml , .wav "in-app" using

file_source = new inputsource(getresources().openrawresource(r.raw.xml));

using raw resource working. i'm trying set resource outside of app , xml document no longer recognized ...

<?xml version="1.0" encoding="utf-8"?> <text> <lots of tag .../> </text>

ther's not typpo in xml ... have clue ?

edit :

file_source = new inputsource(new stringreader( path_dir + "/xml.xml" )); file_source.setencoding("utf-8"); parser.parse(file_source);

it seems avoid bad-formed exception ... app' crash somewhere else, have track downwards ...

try logging inputstream getting.

i don't know inputsource much, guess, there's problem of reading file properly.

try using instead

fileinputstream fis = new fileinputstream(new file("path file)); parser.parse(fis);

android xml file saxparser

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -