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,
                                                            String
qualifiedName)
                                                            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
createAttribute
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
408-777-5814
___________________________________
Received on Wednesday, 29 September 1999 02:58:18 GMT

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