entity_relative_path
newpath=entity_relative_path(path, dir, type)
This function converts the absolute path name given by path into a relative path name if possible. If the file is in or below the same directory as the supplied directory dir, then a path name relative to that directory is returned. If the file is not in or below dir, depending on the value of type, if the file is in or below a directory from one of the path list options being considered, then a path name relative to that directory is returned. Otherwise, the original input path name is returned.
The type parameter can have one of the following values:
• 0 if the reference is to a graphic.
• 1 if the reference is to a file entity.
• 2 if the reference is to an XML inclusion.
• 3 if the reference is a DITA reference.
Related topic