I receive very large xml files which need spot edits (adding elements at particular nodes). The file size makes using DOMDocument or SimpleXML not an option. I'm using XMLReader to parse the file but it appears that my only option is to completely rewrite the file using XMLWriter. I'm curious if there is a better way? Perhaps something that lets me edit the file at the cursor location of XMLReader?
Ideally I'd be doing this on the fly with PHP but I make it work doing a one off with C# to get things up and running if there is a tool that makes this work more efficiently.
XmlReaderin,XmlWriterout is definitely the best way. What's your concern with going that route? - Brian Warshaw