2

I just want to implement a parser to parse my xml. I need clarification from you guys before I start it. Can you guys please suggest a best method or mechanism to parse my xml and rendering it asynchronously.

dimo414
  • 47,227
  • 18
  • 148
  • 244
sek
  • 193
  • 1
  • 1
  • 9
  • 1
    How do you parse your XML? Not all appraoches perform the same and you may get more improvement using a different approach. – Peter Lawrey Dec 08 '10 at 10:19

2 Answers2

4

Do it in separate thread. You can 1. open thread yourself 2. use threadpool 3. use Timer.schdule()

AlexR
  • 114,158
  • 16
  • 130
  • 208
3

Don't reinvent the wheel - JDOM does a fantastic job with XML.

As for doing so asynchronously, I would have the parsing thread parse and build whatever data you need, then make it publicly accessible by assigning it to a volatile variable once it's done. You could also use the callback pattern. Parsing your XML is a separate problem from doing so asynchronously; any asynchronous processing pattern will work just fine.

Community
  • 1
  • 1
dimo414
  • 47,227
  • 18
  • 148
  • 244