All pastes #594578 Raw Edit

fixed?

public text v1 · immutable
#594578 ·published 2007-06-29 00:23 UTC
rendered paste body
function RecurseXML($xml,$parent="")
{
   $child_count = 0;
   foreach($xml as $key=>$value){
      $child_count++;     
      if(RecurseXML($value,$parent.".".$key) == 0)  // no childern, aka "leaf node"
      {
	      if ($parent==".Tournament"){
         	//print($parent . "." . (string)$key . " = " . (string)$value . "<BR>\n");  
         	//print((string)$key . " = " . (string)$value . "<BR>\n");      
$sql.="{$key}='{$value}'";
        	
	      }
      }     
   }
   //echo $sql;
   return $sql;
}
$xml = simplexml_load_file('test2.xml');
$test = RecurseXML($xml);
echo $test;