Re: Implementing NodeList

>For example: If I'm iterating through the NodeList, and in response to
>processing a node I find I have to insert structure earlier in the DOM,
>that's going to blow my iteration loop out of the water -- the indices
>shift, and I'll wind up re-processing earlier nodes -- unless I add code to
>search forward in the NodeList to re-establish my position. Conversely, if
>I delete an earlier node I may skip processing something unless I search
>back. Either can be solved by processing into a second tree, I suppose...
>but if you weren't updating the source tree, the NodeList wouldn't have to
>be live.

Its simpler than it seems.  Each insertion or removal involves incrementing
or decrementing the index by one.

>But if you tell me that script writers want it to work this way, I'll take
>your word for it; you've been looking at this much longer than I.

I find that, while script writers are easily annoyed by seemingly unfamiliar
features, they are amazingly patient with familiar features which are
difficult to use.

Regards,

Don Park
CTO/Docuverse

>
>
>

Received on Monday, 27 July 1998 16:02:58 UTC