XMLReader - How to handle undeclared namespace

吃可爱长大的小学妹 提交于 2019-12-02 20:45:31

问题


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??

来源:https://stackoverflow.com/questions/3555461/xmlreader-how-to-handle-undeclared-namespace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!