You are here: Removing a Child using DOM XML « All PHP « IT news, forums, messages
Removing a Child using DOM XML

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация