def _generate_dom_attrs(attrs, allow_no_value=True):
for attr in iterate_items(attrs):<EOL><INDENT>if isinstance(attr, basestring):<EOL><INDENT>attr = (attr, True)<EOL><DEDENT>key, value = attr<EOL>if value is None:<EOL><INDENT>continue<EOL><DEDENT>if value is True and not allow_no_value:<EOL><INDENT>value = key  <EOL><DEDENT>if value is True:<EOL><INDENT>yield True  <EOL><DEDENT>else:<EOL><INDENT>yield '<STR_LIT>' % (key, value.replace('<STR_LIT:">', '<STR_LIT>'))<EOL><DEDENT><DEDENT>
Yield compiled DOM attribute key-value strings.

    If the value is `True`, then it is treated as no-value. If `None`, then it
    is skipped.