Fix program to parse large XML files / Pull specific fields

Job ID: 34631405

Budget: $30 – $250 USD

Payment up to $100

1. I need to be able to parse large xml files in my api. My current process bombs if the file is over 40 meg.
2. The incoming field layout of the file changes so I need the program to read through the xml then pull out the list of fields asked for in the drop down (sometimes a field will not exist but still need a null value of it). I've attached 3 very small files for you to test on the following link with the program. I need them to pull the layout from the fields that are chosen if possible.

http://t3extract.com/convert-freelancer.php

Parsing Large files - I see references to DOM object and simplexml in the code - I can't manually split files before running conversions. Need to do it at a button press. Below is a portion of the code. The code works fine for smaller than 40m. Can it be changed to Stax or another parser that works with larger files.

$csv_handler = fopen ('downloads_convert/' . basename($filename, ".".$ext) . "_converted.csv", 'w');

$l = 1 ;
foreach($rline as $rlineech)
{
$domObject = new DOMDocument();
$domObject->loadXML($rlineech);
$domXPATH = new DOMXPath($domObject);
$sresults = $domXPATH->query("//soap/*");
// print_r($sresults);
foreach($sresults as $result)
{
$sarray = json_decode(json_encode(simplexml_load_string($result->ownerDocument->saveXML($result))), true);