How to use xml sax parser to read and write a large xml?
I'm trying to remove all the project1 nodes (along with their child elements) from the below sample xml document ( original document is about 30 GB ) using SAX parser.It would be fine to have a separate modified file or ok with the in-line edit. sample.xml <ROOT> <test src="http://dfs.com">Hi</test> <project1>This is old data<foo></foo></project1> <bar> <project1>ty</project1> <foo></foo> </bar> </ROOT> Here is my attempt.. parser.py from xml.sax.handler import ContentHandler import xml.sax class MyHandler(xml.sax.handler.ContentHandler): def __init__(self, out_file): self._charBuffer = []