xml processing : too slow...

Shagshag13 shagshag13 at yahoo.fr
Wed Jul 24 11:32:54 EDT 2002


"Alex Martelli" <aleax at aleax.it> a écrit dans le message de news: xDz%8.132158$vm5.4351067 at news2.tin.it...
> Shagshag13 wrote:
>
> > hello,
> >
> > i need to process *each line* of  many huge files (> 2 million lines) with
> > xml processing, by now i do it with parseString from xml.dom.minidom and
> > it's work.
>
> *shudder* don't use minidom except on SMALL files!!!

yes, but i use minidom on a small amount of data at once because i do something like :

f = file(filename)
while 1:
    line = f.readline()
    if line.find('</') != -1
        xmlLine = parseString(line)
        # do some processing to flatten xml
        # write to output file
    else:
        # write to output file

and yes i use it to do for well-formedness

thanks,

s13.






More information about the Python-list mailing list