10GB XML Blows out Memory, Suggestions?

Diez B. Roggisch deets at nospam.web.de
Tue Jun 6 08:05:11 EDT 2006


axwack at gmail.com schrieb:
> I wrote a program that takes an XML file into memory using Minidom. I
> found out that the XML document is 10gb.
> 
> I clearly need SAX or something else?
> 
> Any suggestions on what that something else is? Is it hard to convert
> the code from DOM to SAX?

Yes.

You could used elementtree iterparse - that should be the easiest solution.

http://effbot.org/zone/element-iterparse.htm

Diez



More information about the Python-list mailing list