Removing a Child using DOM XML

Removing a Child using DOM XML

am 08.09.2007 06:13:29 von Sam

I'm building myself an html/php xml reader and writer. I've got it
mostly finished. It reads an xml file, displays the contents, gives you
a form to fill in to add a new entry (which works) then displays all the
entries again, this time with a checkbox next to each to mark for
deletion and and update button. From that form I get an array of numbers
corresponding to the entries in the xml. (e.g. 134 = you check the
first, third and fourth boxes)

What I can't do now that I find simpleXML doesn't have a remove children
function (stupid) so on the fly, I have switched over to DOM, of which I
understand very little.

How do I, using the DOM model, remove children named in the array?

my xml looks like this:




story 1
Caption 1
picture
url 1


story 2
Caption 2
picture 2
url 2