def pathFromParent(soup, node):
    """ For a given node, walk up the hierarchy in order to find
        the first node in the hierarchy above with a 'path' attribute
    """ 

    running = True
    current = node
    while running:
        current = current.parent
        path = current.get('path')
        if path:
            return str(path)

        if current == soup.body:
            running = False

    return None