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 : Tuesday, 27 October 2009 08:24:50 GMT