Resolving a Relative Reference to a Part Name
If the URI reference obtained in §A.2 is a URI, it is resolved in the regular way, that is, with no package-specific considerations. Otherwise, if the URI reference is a relative reference, it is resolved (with reference to Arc [3-4] in Figure A–1) as follows:
Percent-encode each open bracket ([) and close bracket (]).
Percent-encode each percent (%) character that is not followed by a hexadecimal notation of an octet value.
Un-percent-encode each percent-encoded unreserved character.
Un-percent-encode each forward slash (/) and back slash (\).
Convert all back slashes to forward slashes.
If present in a segment containing non-dot (“.”) characters, remove trailing dot (“.”) characters from each segment.
Replace each occurrence of multiple consecutive forward slashes (/) with a single forward slash.
If a single trailing forward slash (/) is present, remove that trailing forward slash.
Remove complete segments that consist of three or more dots.
Resolve the relative reference against the base URI of the part holding the Unicode string, as it is defined in §5.2 of RFC 3986. The path component of the resulting absolute URI is the part name.