def quoteattr(data, entities={}):
    data = escape(data, entities)
    if '"' in data:
        if "'" in data:
            data = '"%s"' % data.replace('"', "&quot;")
        else:
            data = "'%s'" % data
    else:
        data = '"%s"' % data
    return data

# --- DefaultHandler
Escape and quote an attribute value.
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/xml/sax/saxutils.py/quoteattr