tags:

views:

86

answers:

2
+1  Q: 

parsing huge xml

Hello, I need to parse large XML Feeds (>100 mb) and persist into mysql database. XML files are well formatted and contain many child elements. I was thinking to use Java + XMLbeans and SAX to process the XML feeds and persist.

Please suggest me right approach to handle this case. I am worried about performance.

thanks in advance.

A: 

hi,

please try this url which helps you better way...

http://simplepie.org/
http://github.com/rmccue/simplepie/downloads
VAC-Prabhu
It takes 30 seconds to read the FAQ and realize this isn't the right tool :P http://simplepie.org/wiki/faq/can_simplepie_parse_raw_xml_feeds
Kobi
A: 

XML to class object mapping is definitely the most easy to maintain and one of the sensible way to handle parse+persist problems. I'll suggest to check other solutions for XML mapping. Jibx comes to mind if you are looking for good performance. Please go through: this article before deciding. [WARNING : The article is ancient (2003) and may not reflect today's versions of the frameworks. Although you can use similar comparison to try out various options.]

XML Pull parsing is also a good (but obscure) option for very large XML files. (IMO 100MB is not that big.) Try to look at XPP and XML Pull Parsing. But this takes care of parsing only. However you can easily implement your own persist code over the pull parser. Maintaining such code is another story though.

Elister
Hi Elister,Thank you for the detailed response. Will go with object mapping.
datag