def get_style_dict(tree):
<EOL>headers = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>}<EOL>if tree is None:<EOL><INDENT>return {}<EOL><DEDENT>w_namespace = get_namespace(tree, '<STR_LIT:w>')<EOL>result = {}<EOL>for el in tree:<EOL><INDENT>style_id = el.get('<STR_LIT>' % w_namespace)<EOL>el_result = {<EOL>'<STR_LIT>': False,<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': None,<EOL>}<EOL>name = el.find('<STR_LIT>' % w_namespace)<EOL>if name is None:<EOL><INDENT>continue<EOL><DEDENT>value = name.get('<STR_LIT>' % w_namespace).lower()<EOL>if value in headers:<EOL><INDENT>el_result['<STR_LIT>'] = headers[value]<EOL><DEDENT>rpr = el.find('<STR_LIT>' % w_namespace)<EOL>if rpr is None:<EOL><INDENT>continue<EOL><DEDENT>size = rpr.find('<STR_LIT>' % w_namespace)<EOL>if size is None:<EOL><INDENT>el_result['<STR_LIT>'] = None<EOL><DEDENT>else:<EOL><INDENT>el_result['<STR_LIT>'] = size.get('<STR_LIT>' % w_namespace)<EOL><DEDENT>based_on = el.find('<STR_LIT>' % w_namespace)<EOL>if based_on is None:<EOL><INDENT>el_result['<STR_LIT>'] = None<EOL><DEDENT>else:<EOL><INDENT>el_result['<STR_LIT>'] = based_on.get('<STR_LIT>' % w_namespace)<EOL><DEDENT>result[style_id] = el_result<EOL><DEDENT>return result<EOL>
Some things that are considered lists are actually supposed to be H tags
(h1, h2, etc.) These can be denoted by their styleId