Re: [PHP] Re: remove SimpleXML nodes

2006-09-01 Thread Javier Ruiz
Thanks a lot to all :) Using DOM I can do what I need. Anyway I was trying the proposed solutions with SimpleXML but none of them worked for me :( I tried splitting $key and $value in the foreach command, but when I dump the xml (with the asXML function) I still have the nodes that I supposed

Re: [PHP] Re: remove SimpleXML nodes

2006-09-01 Thread Adam Zey
It seems there's no way to do this. You can unset certain things in simpleXML objects, but it's really strange non-standard behaviour. If I have this for an XML document: ?xml version='1.0'? document testfoo/test testbar/test testbaz/test /document XML; and I run that through simplexml

[PHP] Re: remove SimpleXML nodes

2006-08-31 Thread Adam Zey
Javier Ruiz wrote: Hi all, 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

Re: [PHP] Re: remove SimpleXML nodes

2006-08-31 Thread Curt Zirzow
On 8/31/06, Adam Zey [EMAIL PROTECTED] wrote: Javier Ruiz wrote: Hi all, 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