|
Posted by sam on 09/08/07 04:13
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:
<?xml version="1.0"?>
<stories>
<story>
<heading>story 1</heading>
<caption>Caption 1</caption>
<picture>picture </picture>
<url>url 1</url>
</story>
<story>
<heading>story 2</heading>
<caption>Caption 2</caption>
<picture>picture 2</picture>
<url>url 2</url>
</story>
</stories>
Navigation:
[Reply to this message]
|