#NEWLINE# def getElementById( element , id ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# element_id = DOM . getAttribute ( element , 'id' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# element_id = None #NEWLINE# #UNINDENT# if ( ( element_id is not None ) and ( element_id == id ) ) : #NEWLINE# #INDENT# return element #NEWLINE# #UNINDENT# child = DOM . getFirstChild ( element ) #NEWLINE# while ( child is not None ) : #NEWLINE# #INDENT# ret = getElementById ( child , id ) #NEWLINE# if ( ret is not None ) : #NEWLINE# #INDENT# return ret #NEWLINE# #UNINDENT# child = DOM . getNextSibling ( child ) #NEWLINE# #UNINDENT# return None