views:

55

answers:

0

I'm reading a large ~300Mb gzipped XML file with XMLReader that get's automatically dumped to my server nightly (archaic, I know..) It is malformed ie, it has an undefined namespace and it's throwing an error

ErrorException [ Warning ]: XMLReader::read() namespace error : Namespace prefix xsi for AttrName on NodeName is not defined

What is the best way to deal with this? It seems impractical to uncompress, load the whole thing into memory, replace a string, write it again -- gzipped. The file is huge.

The whole reason I'm using XMLReader is to prevent loading the whole file into memory during parsing.

What should I do??