Resolving a Pack URI to a Resource
The following is an algorithm for resolving a pack URI to a resource (either a package or a part):
Parse the pack URI into the potential three components: scheme, authority, path, as well as any fragment identifier.
In the authority component, replace all commas (,) with forward slashes (/).
Un-percent-encode ASCII characters in the resulting authority component.
The resultant authority component is the URI for the package as a whole.
If the path component is empty, the pack URI resolves to the package as a whole and the resolution process is complete.
A non-empty path component shall be a valid part name. If it is not, the pack URI is invalid.
The pack URI resolves to the part with this part name in the package identified by the authority component.
Example B–4. Resolving a pack URI to a resource
Given the pack URI:
pack://http%3c,,www.my.com,packages.aspx%3fmy.package/a/b/foo.xml
The components:
<authority>= http%3c,,www.my.com,packages.aspx%3fmy.package <path>= /a/b/foo.xml
Are converted to the package URI:
http://www.my.com/packages.aspx?my.package
And the path:
/a/b/foo.xml
Therefore, this URI refers to a part named “/a/b/foo.xml” in the package at the following URI: http://www.my.com/packages.aspx?my.package.