Parsing XML file stored in internal storage using DOM parser in android. -



Parsing XML file stored in internal storage using DOM parser in android. -

i have created xml file in device's internal storage described on android developers website. want parse file using dom parser. need create dom parser read xml file?? here's snippet:

documentbuilderfactory dbf = documentbuilderfactory.newinstance(); documentbuilder db = dbf.newdocumentbuilder(); document dom = db.parse(new inputsource(new stringreader(data))); dom.getdocumentelement().normalize();

what need set in place of "data" in:

document dom = db.parse(new inputsource(new stringreader(data)));

i know it's silly help appreciated.

you can create input stream of xml string below , getting nodes can parse values.

inputstream = new bytearrayinputstream(thexmlstring.getbytes("utf-8")); // build xml document documentbuilderfactory dbf = documentbuilderfactory.newinstance(); documentbuilder db = dbf.newdocumentbuilder(); document doc = db.parse(is);

remember passing xml file string.

android xml dom xml-parsing domparser

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

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