'Get an attribute value. The method knows which namespace the attribute is in'

def getAttribute(self, attr):

    allowed_attrs = self.allowed_attributes()
    if (allowed_attrs is None):
        if (type(attr) == type(())):
            (prefix, localname) = attr
            return self.getAttrNS(prefix, localname)
        else:
            raise AttributeError('Unable    to    get    simple    attribute    -    use    (namespace,    localpart)')
    else:
        allowed_args = [a[1].lower().replace('-', '') for a in allowed_attrs]
        i = allowed_args.index(attr)
        return self.getAttrNS(allowed_attrs[i][0], allowed_attrs[i][1])
