3

I'm trying to use XMLPullParser to parse a large XML document for an Android application. Often I need to re-traverse the document from the beginning.

  1. How would I reset the parser? It seems inefficient to call getResources.getXML() repeatedly. What about calling calling setInput on the parser directly to reset? Is there a code example.

  2. If the xml document needs to be traversed multiple times, is XMLPullParser still recommended for performance concerns.

Regards

Roy Battie
  • 31
  • 1
  • 1
    I have also the same question. I was thinking of using a singleton to parse the XML file. Haven't tried it yet, though. – springrolls Jan 07 '11 at 13:56
  • Same question. Already spend 10 hours hacking code trying to solve this problem. This side of Android/Java is not so nicely crafted I would say. – Shailen Aug 28 '12 at 18:32

0 Answers0