PHP XMLReader read , edit Node , write XMLWriter
问题 I have an XML file which is very very large (millions of records). Due to speed and memory constraints I plan to use XMLReader / XMLWriter . I need to read the file, getting one record, change its attribute, and finally save XML again. For testing I created an XML file and write some records into it using these lines: $doc = new XMLWriter(); $doc->openURI($xmlFile); $doc->startDocument('1.0','UTF-8'); $doc->setIndent(4); $doc->startElement('DBOS'); for($r=0;$r<10; $r++){ $doc->startElement(