'Extracts a subset of the attributes from the given element and
returns them in a dictionary.
:param d: A dictionary in which to store the attributes.
:type d: dict
:param elt: An ElementTree Element
:type elt: Element
:return: Returns the input dict ``d`` possibly including attributes from ``elt``
:rtype: dict'

def _load_xml_attributes(self, d, elt):

    d = type(d)(d)
    try:
        attr_dict = elt.attrib
    except AttributeError:
        return d
    if (attr_dict is None):
        return d
    ignore_attrs = [u'xsi', u'schemaLocation', u'xmlns', u'bgColor', u'fgColor']
    for attr in attr_dict:
        if any((attr.endswith(x) for x in ignore_attrs)):
            continue
        val = attr_dict[attr]
        if val.isdigit():
            d[attr] = int(val)
        else:
            d[attr] = val
    return d
