import warnings


def get_relative_tag_xpath(schema_dict, name, root_tag, contains=None, not_contains=None):
    """
    DEPRECATED

    Tries to find a unique relative path from the schema_dict based on the given name of the tag
    name of the root, from which the path should be relative and additional further specifications

    :param schema_dict: dict, containing all the path information and more
    :param name: str, name of the tag
    :param root_tag: str, name of the tag from which the path should be relative
    :param contains: str or list of str, this string has to be in the final path
    :param not_contains: str or list of str, this string has to NOT be in the final path

    :returns: str, xpath for the given tag

    :raises ValueError: If no unique path could be found
    """
    warnings.warn(
        'get_relative_tag_xpath is deprecated. Use the relative_tag_xpath method on the schema dictionary instead',
        DeprecationWarning)
    return schema_dict.relative_tag_xpath(name, root_tag, contains=contains, not_contains=not_contains)