PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > DOM XML
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
DOM XML

Réponse
 
LinkBack Outils de la discussion
Vieux 10/09/2007, 05h17   #1 (permalink)
sam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut DOM XML

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?

§
  Réponse avec citation
Vieux 10/09/2007, 12h55   #2 (permalink)
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: DOM XML

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
==================
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h53.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,06714 seconds with 10 queries