def modify_header_attributes(dom, headerattr):
    """
    the function do not modify links
    """
    head = dom.documentElement.getElementsByTagName('head')[0]
    for no in head.childNodes:
        if no.localName == 'META':
            raise ValueError('upper META')
        if no.localName == 'meta' and 'name' in no.attributes:
            name = no.attributes['name'].value
            if name in headerattr:
                content = headerattr[name]
                if not isinstance(content, str):
                    raise TypeError('content should be a string not ' + str
                        (type(content)))
                no.attributes['content'].value = content
        for key in ['title']:
            if no.localName == key and key in headerattr:
                content = headerattr['title']
                if not isinstance(content, str):
                    raise TypeError('content should be a string not ' + str
                        (type(content)))
                no.value = content
