W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2000

Re: Element interface

From: <keshlam@us.ibm.com>
Date: Tue, 7 Mar 2000 08:29:10 -0500
To: Dieter Köhler <dieter.koehler@ppp.uni-bamberg.de>
cc: "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <8525689B.004A1427.00@D51MTA03.pok.ibm.com>
>Consequence:  When coding the API I cannot easily use a NamedNodeMap
>to store the attributes of an element.  Well, I can catch the
>exception, but that is neither elegant nor fast.

That's one solution. If we assume that removing a nonexistant attribute is
an uncommon action -- which is probably true -- performance is probably not
a major concern; you only pay a penalty if the exception must be thrown and

Another approach is to check whether the named item is present in the
NamedNodeMap before you remove it.

Another approach is to provide yourself with a private mechanism that
doesn't throw the exception. What a DOM implementation publishes to the
outside world, and what it looks like internally, may be very different

There are existing Level 1 DOM implementations that handle this case
successfully. "If it happens, it must be possible."

Joe Kesselman  / IBM Research
Received on Tuesday, 7 March 2000 08:29:27 UTC

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