def rel_to_abs(target: str, namespace: str):
    """Convert name relative to namespace to absolute"""
    ns = namespace.split('.')
    nslen = len(ns)
    dots = 0
    while dots < len(target) and target[dots] == '.':
        dots += 1
    shared = nslen - dots + 1
    tg = target[dots:].split('.') if dots < len(target) else []
    abs = ns[:shared] + tg
    return '.'.join(abs)
