views:

184

answers:

2

I basicly need to load the whole XML file, add a new line with content and then saving it. But I wondered which one is faster.. XMLWriter or SimpleXML? Oh, and, it's mainly large XML files, more then 10MB.

Thanks!

A: 

Write a test harness and measure it.

chibacity
A: 

As per PHP's manual, XMLWriter "provides a non-cached, forward-only means of generating streams or files containing XML data."

It cannot be used to load a document and modify it, therefore it's not an option and you're pretty much left with SimpleXML.

Josh Davis
Thanks for the tech translation!
AESM
You could combine an XMLReader and XMLWriter. But I doubt it to be faster in php.
VolkerK