[XML-SIG] Re: getElementsByTagName interpretation
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
> 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.
> Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.
> XML-SIG maillist - XML-SIG@python.org
Mike Olson Principal Consultant
email@example.com (303)583-9900 x 102
Fourthought, Inc. http://Fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python