#NEWLINE# def to_xml( self , doc , root ) : #NEWLINE# #INDENT# table = doc . createElement ( 'table' ) #NEWLINE# root . appendChild ( table ) #NEWLINE# if ( self . title is not None ) : #NEWLINE# #INDENT# title = doc . createElement ( 'title' ) #NEWLINE# title . appendChild ( doc . createTextNode ( self . title ) ) #NEWLINE# table . appendChild ( doc ) #NEWLINE# #UNINDENT# headers = doc . createElement ( 'headers' ) #NEWLINE# content = doc . createElement ( 'content' ) #NEWLINE# table . appendChild ( headers ) #NEWLINE# table . appendChild ( content ) #NEWLINE# visible_cols = list ( filter ( ( lambda col : col . visible ) , self . columns ) ) #NEWLINE# for col in visible_cols : #NEWLINE# #INDENT# xmlcol = doc . createElement ( col . key ) #NEWLINE# xmlcol . appendChild ( doc . createTextNode ( col . label ) ) #NEWLINE# headers . appendChild ( xmlcol ) #NEWLINE# #UNINDENT# def output_xml( row_data , parent ) : #NEWLINE# #INDENT# xmlrow = doc . createElement ( 'row' ) #NEWLINE# for col in visible_cols : #NEWLINE# #INDENT# xmlfield = doc . createElement ( col . key ) #NEWLINE# xmlfield . appendChild ( doc . createTextNode ( col . get_value ( self , row_data ) ) ) #NEWLINE# xmlrow . appendChild ( xmlfield ) #NEWLINE# #UNINDENT# parent . appendChild ( xmlrow ) #NEWLINE# return xmlrow #NEWLINE# #UNINDENT# def gen_children( parent ) : #NEWLINE# #INDENT# children = doc . createElement ( 'children' ) #NEWLINE# parent . appendChild ( children ) #NEWLINE# return children #NEWLINE# #UNINDENT# self . iter_rowlist ( self . rows , output_xml , content , gen_children ) #NEWLINE# return doc