def METHOD_NAME(cls, target: Class, attribute: DtdAttribute):
    attr_type = cls.build_attribute_type(target, attribute)
    attr = Attr(
        name=attribute.name,
        namespace=target.ns_map.get(attribute.prefix),
        tag=Tag.ATTRIBUTE,
        types=[attr_type],
    )
    cls.build_attribute_restrictions(
        attr, attribute.default, attribute.default_value
    )
    attr.index = len(target.attrs)
    target.attrs.append(attr)