W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

Re: DOM - odd absent interface method?

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Mon, 21 May 2001 10:17:38 -0400
To: W3C DOM mailing list <www-dom@w3.org>
Message-ID: <OF384CF444.71CEF8F0-ON85256A53.004DE17D@pok.ibm.com>

> it can be very
>expensive to create a new node, migrate children & attribute nodes of
>the original, and the replace the original with the new node.

Shouldn't be, in most cases, unless you have a huge number of children or
perform this operation extremely frequently. More expensive than just
changing the node name, granted. But part of the tradeoff one accepts for a
portable API is that it may have been forced to accept compromises which
make it less than ideal for some tasks.

>  It also makes the code more difficult to read and maintain.

Shouldn't be, if you write a subroutine which performs this operation and
invoke that. (Note too that this subroutine might be able to check whether
you're working with a DOM implementation which has a custom feature for
this purpose, and leverage that, without the rest of your code having to be
aware of it... while still retaining the explicit replace-the-node solution
for other DOMs.)

Joe Kesselman  / IBM Research
Received on Monday, 21 May 2001 10:18:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC