def xml_to_html(html_flag, xml_string, base_url=None):
if not xml_string or not html_flag is True:<EOL><INDENT>return xml_string<EOL><DEDENT>html_string = xml_string<EOL>html_string = remove_comment_tags(html_string)<EOL>if '<STR_LIT:<>' in html_string or '<STR_LIT:>>' in html_string:<EOL><INDENT>html_string = escape_html(html_string)<EOL><DEDENT>html_string = replace_xref_tags(html_string)<EOL>html_string = replace_ext_link_tags(html_string)<EOL>html_string = replace_email_tags(html_string)<EOL>html_string = replace_inline_graphic_tags(html_string, base_url)<EOL>html_string = replace_named_content_tags(html_string)<EOL>html_string = replace_mathml_tags(html_string)<EOL>html_string = replace_table_style_author_callout(html_string)<EOL>html_string = replace_simple_tags(html_string, '<STR_LIT>', '<STR_LIT:i>')<EOL>html_string = replace_simple_tags(html_string, '<STR_LIT>', '<STR_LIT:b>')<EOL>html_string = replace_simple_tags(html_string, '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>html_string = replace_simple_tags(html_string, '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>html_string = replace_simple_tags(html_string, '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>html_string = replace_simple_tags(html_string, '<STR_LIT>', None)<EOL>html_string = replace_simple_tags(html_string, '<STR_LIT>', '<STR_LIT>')<EOL>return html_string<EOL>
For formatting json output into HTML friendly format