Ciao a tutti,
ho creato questo script per fare il parsing di un file xml.

Premetto che sono nuovo sia di Php che di DB...

Per ogni nodo xml dovrei creare una colonna nel db e mettere come valore il valore del nodo....qualcuno mi sa aiutare?

Codice PHP:
<?php

$test 
true ;

$test?$xml simplexml_load_file('bbb.xml') : $xml =simplexml_load_file("aaa.xml");


//

if($test) echo $xml->getName() . "
"
;
foreach(
$xml->children() as $child)
  {
  foreach(
$child->attributes() as $attributeskey){
 if(
$test)echo "-".$attributeskey->getName() . ": " $attributeskey "
"
;

 foreach(
$child->children() as $child2)
  {
 if(
$test)  echo "--".$child2->getName() . ": " $child2 "
"
;
   foreach(
$child2->children() as $child3)
  {
 if(
$test)  echo "---".$child3->getName() . ": " $child3 "
"
;
 foreach(
$child3->attributes() as $attributeskey3){

 if(
$test) echo "----".$attributeskey3->getName() . ": " $attributeskey3 "
"
;
}
}
  }
  }
  }
?>