remove SimpleXML nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Is there any way to remove a non-unique* *node using SimpleXML?
For example, let's say I have:

$myXML = <<ENDXML
<database ...>
 <table name='one'>
     ...
 </table>
 <table name='two'>
     ...
 </table>
 <table name='three'>
     ...
 </table>
</database>
ENDXML;


So I want to do...

$xmlDatabase = new SimpleXMLElement($myXML);
foreach ($xmlDatabase as $oneTable)
{
  if ($oneTable['name'] == 'two')
  {
     ///  ---- HERE I WANT TO DELETE THE $oneTable NODE
     unset($oneTable);   // <-- and this doesn't work...
  }
}


any ideas?

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux