DOM removeChild Problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I have a problem concerning removeChild. This is the XML structure I use =
with php:


now, if I want to delete the whole language1 I use the following code:
$okay = $xml_dom->removeChild($toDelete);

but if I try to delete a site like that:
$okay = $xml_dom->removeChild($toDelete);

i get a Fatal error: Uncaught exception 'DOMException' with message 'Not =
Found Error'=20

with google i found a hint how to solve the problem, it said that the =
removeChild method refers to the current selected node and that I have =
to use the method having selected the concerning Node. But how can I do =
this? Probably amateurish I tried to do it like this way:


normally I use SimpleXML to handle XML-files, but in SimpleXML there is =
no way to delete a child so I had to use DOM, which I think is very =
complicated - however I would be very thankful if someone could explain =
the above mentioned problem to me. thank you!

Re: DOM removeChild Problem

Quoted text here. Click to load it

Site Timeline