W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1999

Element setAttributeNS should have qualifiedname parameter.

From: <rpfeiffe@us.ibm.com>
Date: Tue, 28 Sep 1999 16:57:52 -0400 (EDT)
To: www-dom@w3.org
Message-ID: <872567FA.00731AFF.00@d53mta03h.boulder.ibm.com>

The method createAttributeNS in Document interface is declared as:
public Attr               createAttributeNS(String namespaceURI,
                                                            throws DOMException;

However, the method setAttributeNS in Element interface is defined as:
public void               setAttributeNS(String namespaceURI,
                                                         String localName,
                                                         String value)
                                                         throws DOMException;

Notice that in setAttribute the 2nd parameter is localName and in
the 2nd parameter is qualifiedName.

Now, since the method setAttributeNS is defined to add an attribute if it
doesn't exist,
the typical code calls createAttributeNS in that case. However, in doing so
we lose information, namely the prefix.

I believe that the setAttributeNS call should have qualifiedName as input
parameter as in:
public void               setAttributeNS(String namespaceURI,
                                                         String qualifiedName,
                                                         String value)
                                                         throws DOMException;

Ralf I Pfeiffer
Java Technology Center, Silicon Valley
XML Technology Group
Internet email: rpfeiffe@us.ibm.com
Lotus Notes: Ralf Pfeiffer/Cupertino/IBM
Received on Wednesday, 29 September 1999 02:58:18 UTC

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