#NEWLINE# def set_attribute( self , name , val , ns = '' ) : #NEWLINE# #INDENT# 'set_attribute(name, value)\n        Set the element node attribute "name" to "value".\n        The name can be the shorthand identifier, or the real name.\n        ' #NEWLINE# if ( ':' in name ) : #NEWLINE# #INDENT# self . _attribs [ name ] = POMAttribute ( name , val ) #NEWLINE# return True #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# xmlattr = self . __class__ . ATTRIBUTES [ name ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# xmlattr = self . __class__ . KWATTRIBUTES [ name ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# self . _attribs [ xmlattr . name ] = POMAttribute ( xmlattr . name , val , ns ) #NEWLINE# return True