tags:

views:

200

answers:

2

I am using DOM parser to parse xml data, but its taking lots of time to parse it on line 3 where "is" is the InputStrem object. Here is my code.

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder(); 
Document document = builder.parse(is);

how can i do it in a small time with large xml data.

can any body help me...

+1  A: 

Use the XmlPullParser available on Android, it is super light weight.

ng
A: 

VTD-XML is ideally suited for parsing large XML documents when DOM consumes too much memory. It is better than Pul parsing in that it retains random acess and natively supports xpath 1.0...

vtd-xml-author
Note that Mr. Zhang is the author of VTD-XML.
John Saunders