PHP: How to replace existing XML node with XMLWriter

CDnahunwina

New Member
I am editing an XML file and need to populate it with data from a database. DOM works but it is unable to scale to several hundreds of MBs so I am now using XMLReader and XMLWriter which can write the very large XML file. Now, I need to select a node and add children to it but I can't find a method to do it, can someone help me out? I can find the node I need to add children to by: \[code\]if ($xmlReader->nodeType == XMLReader::ELEMENT && $xmlReader->name == 'data') { echo 'data was found'; $data = http://stackoverflow.com/questions/15822118/$xmlReader->getAttribute('data'); }\[/code\]How do I now add more nodes/children to the found node?
 
Back
Top