I am trying to transform a large xml file (about 50mb) in php using the following code:
// Load the XML source
$xml = new DOMDocument;
$xml->load($dir . 'xml/vapProducts.xml');
$xsl = new DOMDocument;
$xsl->load($dir . 'all_products.xsl');
// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
$resulttxt= $proc->transformToXML($xml);
This works fine on my local dev machine but when I upload it to my hosting provider it fails with an out of memory error.
Is there a way to make the transfor more efficient or do it incrementally rather than loading the whole xml file into memory?
Thanks,
John