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
caught.

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
things.


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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:47 GMT