Re: Two questions

Lars Marius Garshol wrote:

> 1. What is the result of
> document.createAttribute("a")._get_nodeValue()?
> 
>   Is it None or ""?  As far as I can see neither of the level 1 and
>   level 2 specs answer this question.  None would be the most
>   reasonable answer, methinks, but some implementations think
>   otherwise.
...
>   OpenXML:  ""

Since Delphi does not treat wideStrings as ordinary objects I always
use an empty string where the DOM prescribes a null pointer.  In my
opinion DOM 2 should explicitly allow this by modifying §1.1.5.

> 2. What is the result of calling
> element.removeAttribute("non-existent")?
> 
>   The specs (1 and 2) seem to say that nothing should happen, and that
>   is my own interpretation.

I agree.  The problem probably arises in some implementation, because
NamedNodeMap.removeNamedItem() will raise a NOT_FOUND_ERR exception,
i.e. if you use instead of the above example
element.attributes.removeNamedItem("non-existent") you should raise an
exception.  So if an implementation just transforms a
removeAttribute() call into a removeNamedItem() call of the Element's
attribute list it is not conforming with the DOM spec.  

Though it is a constant pitfall for implementations, the DOM WG
decided not to harmonize the NamedNodeMap- and the Element-calls,
because of backward compatibility.

-- 
=====================================================================
 Dieter Koehler, M. A. - dieter.koehler@ppp.uni-bamberg.de
 Mittlere Kaulberg 22, D-96049 Bamberg, +49(0)951-5190726
 "http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
 "http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
 "http://www.philo.de/xml/": Open XML - XML-Komponenten fuer Delphi
=====================================================================

Received on Tuesday, 23 May 2000 12:06:08 UTC