#NEWLINE# def startHTML( title = None , cssReplacements = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# writer = XMLWriter ( ) #NEWLINE# writer . begintag ( 'html' , xmlns = 'http://www.w3.org/1999/xhtml' , lang = 'en' ) #NEWLINE# writer . begintag ( 'head' ) #NEWLINE# writer . simpletag ( 'meta' , http_equiv = 'Content-Type' , content = 'text/html; charset=utf-8' ) #NEWLINE# if ( title is not None ) : #NEWLINE# #INDENT# writer . begintag ( 'title' ) #NEWLINE# writer . write ( title ) #NEWLINE# writer . endtag ( 'title' ) #NEWLINE# #UNINDENT# writer . begintag ( 'style' , type = 'text/css' ) #NEWLINE# css = defaultCSS #NEWLINE# for ( before , after ) in cssReplacements . items ( ) : #NEWLINE# #INDENT# css = css . replace ( javascript , after ) #NEWLINE# #UNINDENT# writer . write ( css ) #NEWLINE# writer . endtag ( 'style' ) #NEWLINE# writer . begintag ( 'script' , type = 'text/javascript' ) #NEWLINE# javascript = defaultJavascript #NEWLINE# javascript = javascript . replace ( '<' , 'l_e_s_s' ) #NEWLINE# javascript = javascript . replace ( '>' , 'g_r_e_a_t_e_r' ) #NEWLINE# writer . write ( javascript ) #NEWLINE# writer . endtag ( 'script' ) #NEWLINE# writer . endtag ( 'head' ) #NEWLINE# writer . begintag ( 'body' ) #NEWLINE# return writer