You are here: Re: DOM XML « All PHP « IT news, forums, messages
Re: DOM XML

Posted by Jerry Stuckle on 09/10/07 11:55

sam wrote:
> I'm cycling through an DOM Object and removing nodes. My problem is if I
> want to remove nodes 1 and 3, it wants to remove nodes 1 and 4, because
> once node 1 is removed, node 4 is now in the 3 slot.
>
> Any direction or suggestions?
>
> §

Yep, keep trace of what you want to remove and move the others up, start
from the back end and remove them moving up, or rescan after every removal.

As a general rule, *any* time you change data (not just a DOM object)
the data may be reordered. Never depend on the order remaining the same
after modifying the data - that includes adding and changing data, also
(although those probably wouldn't have an effect in this case).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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