[XML-SIG] Re: getElementsByTagName interpretation

Mike Olson Mike.Olson@fourthought.com
Sun, 25 Jun 2000 09:47:37 -0600


Rosalie Dieteman wrote:
> 
>     Where this falls down is .getElementByTagName('X'), which returns a
>     NodeList containing all 'X' elements in the tree. If this is live,
>     then every time you modify the DOM tree by adding, deleting, or moving
>     an element, you have to ask "Are there any .getElementByTagName()
>     NodeLists out there that would change as a result of this?" If you
>     consider a change that moves or deletes many elements, such as
>     deleting a chapter from a book, this seems quite expensive and
>     time-consuming.
> 
> Another nasty situation I can think of is stepping through a NodeList deleting
> the nodes as you step through... in a "live" list, the list you're stepping
> through would be changing as you step... The obvious answer is to step last to
> first, but it's one more argument against "live"ness.

I'd thought of this one too, but luckily there is no delete interface
defined on a node list.  Only accessor functions.  so you can't change
the list with only a reference to the list.


Mike


> 
> ____________________________________________________________________
> Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.
> 
> _______________________________________________
> XML-SIG maillist  -  XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig

-- 
Mike Olson				 Principal Consultant
mike.olson@fourthought.com               (303)583-9900 x 102
Fourthought, Inc.                         http://Fourthought.com 
Software-engineering, knowledge-management, XML, CORBA, Linux, Python