code: def setAttributeNS(self, namespaceURI, localName, value):
          '''
          Keyword arguments:
              namespaceURI -- namespace of attribute to create, None is for
                  attributes in no namespace.
              localName -- local name of new attribute
              value -- value of new attribute
          ''' 
          prefix = None
          if namespaceURI:
              try:
                  prefix = self.getPrefix(namespaceURI)
              except KeyError, ex:
                  prefix = 'ns2'
                  self.setNamespaceAttribute(prefix, namespaceURI)
          qualifiedName = localName
          if prefix:
              qualifiedName = '%s:%s' %(prefix, localName)
          self._setAttributeNS(namespaceURI, qualifiedName, valuef setAttributeNS(self, namespaceURI, localName, value):
          '''
          Keyword arguments:
              namespaceURI -- namespace of attribute to create, None is for
                  attributes in no namespace.
              localName -- local name of new attribute
              value -- value of new attribute
          ''' 
          prefix = None
          if namespaceURI:
              try:
                  prefix = self.getPrefix(namespaceURI)
              except KeyError, ex:
                  prefix = 'ns2'
                  self.setNamespaceAttribute(prefix, namespaceURI)
          qualifiedName = localName
          if prefix:
              qualifiedName = '%s:%s' %(prefix, localName)
          self._setAttributeNS(namespaceURI, qualifiedName, value)
docs: Keyword arguments:
              namespaceURI -- namespace of attribute to create, None is for
                  attributes in no namespace.
              localName -- local name of new attribute
              value -- value of new attribute