

def create_html(tree, meta_data):
    new_html = etree.Element('html')
    w_namespace = get_namespace(tree, 'w')
    visited_nodes = []
    _strip_tag(tree, ('%ssectPr' % w_namespace))
    for el in tree.iter():
        if (el in visited_nodes):
            continue
        header_value = is_header(el, meta_data)
        if is_header(el, meta_data):
            p_text = get_element_content(el, meta_data)
            if (p_text == ''):
                continue
            new_html.append(etree.XML(('<%s>%s</%s>' % (header_value, p_text, header_value))))
        elif (el.tag == ('%sp' % w_namespace)):
            if is_title(el):
                continue
            if is_li(el, meta_data):
                li_nodes = get_single_list_nodes_data(el, tree)
                (new_el, list_visited_nodes) = build_list(li_nodes, meta_data)
                visited_nodes.extend(list_visited_nodes)
            else:
                p_text = get_element_content(el, meta_data)
                if (p_text == ''):
                    continue
                new_el = etree.XML(('<p>%s</p>' % p_text))
            new_html.append(new_el)
        elif (el.tag == ('%stbl' % w_namespace)):
            (table_el, table_visited_nodes) = build_table(el, meta_data)
            visited_nodes.extend(table_visited_nodes)
            new_html.append(table_el)
            continue
        visited_nodes.append(el)
    result = etree.tostring(new_html, method='html', with_tail=True)
    return _make_void_elements_self_close(result)

dataset/ETHPy150Open PolicyStat/docx2html/docx2html/core.py create_html/VarMisuse@174/253 `meta_data`->`tree`