= URI =
{{{#!rst
Purpose:
Utility methods which convert to and from file paths and create absolute or relative URIs.
Namespace:
urn:WebWorks-XSLT-Extension-URI
Prefix:
wwuri
Methods:
IsFile(string uriAsString):
Determine if the supplied URI refers to the file system.
Returns:
Boolean.
Example:
Determine if ``\\network\filesystem\file`` and ``file:///network/filesystem/file`` are file URIs.
::
AsFilePath(string uriAsString):
Convert a file URI into a system file path.
Returns:
File path as string.
Example:
Convert URIs ``\\network\filesystem\file`` and ``file:///network/filesystem/file`` to file paths.
::
AsURI(string uriAsString):
Convert file paths to URIs.
Returns:
URI as string.
Example:
Convert ``C:\file`` to a URI.
::
PossibleResolvedUris(string uriAsString):
Convert file paths to URIs.
Returns:
Node set of possible resolved URIs for the given virtual URI.
::
Example:
Resolve virtual URI ``wwformat:Transforms/pages.xsl``.
::
...
GetRelativeTo(string uriAsString, string anchorUriAsString):
Convert an absolute URI into a relative URI.
Returns:
URI as string.
Example:
Determine the relative path to ``http://www.webworks.com/css/webworks.css`` from ``http://www.webworks.com/information/index.html``.
::
MakeAbsolute(string absoluteUriAsString, string uriAsString):
Convert a relative URI into an absolute URI. If the second parameter is already an absolute URI, it will be returned unchanged.
Returns:
URI as string.
Example:
Fully qualify the relative URI ``../css/webworks.css`` against the absolute URI ``http://www.webworks.com/information/index.html``.
::
EscapeUri(string unescapedUri):
Convert unescaped URI into an escaped URI path.
Returns:
Escaped URI as a string.
Example:
Convert ``http://www.webworks.com/name with spaces.html`` to ``http://www.webworks.com/name%20with%20spaces.html``.
::
EscapeData(string unescapedString):
Convert unescaped string into an escaped URI data.
Returns:
Escaped string.
Example:
Convert ``http://www.webworks.com/name with spaces.html`` to ``http%3a%2f%2fwww.webworks.com%2fname%20with%20spaces.html``.
::
Unescape(string escapedString):
Convert URI escaped string into unescaped string (%20 to space, etc.).
Returns:
Unescaped string.
Example:
Convert ``name%20with%20spaces.html`` to ``name with spaces.html``.
::
}}}