EVOLUTION-MANAGER
Edit File: getRelativeURL.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Compute name of URL relative to a base URL</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for getRelativeURL {XML}"><tr><td>getRelativeURL {XML}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compute name of URL relative to a base URL</h2> <h3>Description</h3> <p>This function is a convenience function for computing the fullly qualified URI of a document relative to a base URL. It handles the case where the document is already fully qualified and so ignores the base URL or, alternatively, is a relative document name and so prepends the base URL. It does not (yet) try to be clever by collapsing relative directories such as "..". </p> <h3>Usage</h3> <pre> getRelativeURL(u, baseURL, sep = "/", addBase = TRUE, simplify = TRUE, escapeQuery = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>u</code></td> <td> <p>the location of the target document whose fully qualified URI is to be determined.</p> </td></tr> <tr valign="top"><td><code>baseURL</code></td> <td> <p>the base URL relative to which the value of <code>u</code> should be interpreted.</p> </td></tr> <tr valign="top"><td><code>sep</code></td> <td> <p>the separator to use to separate elements of the path. For external URLs (e.g. accessed via HTTP, HTTPS, FTP), / should be used. For local files on Windows machines one might use <code>.Platform$file.sep</code>, but this is incorrect unless one knows that the resulting file is to be accessed using Windows file system notation, i.e. <code>C:\\my\\folder\\file</code>. </p> </td></tr> <tr valign="top"><td><code>addBase</code></td> <td> <p>a logical controlling whether we prepend the base URL to the result.</p> </td></tr> <tr valign="top"><td><code>simplify</code></td> <td> <p>a logical value that controls whether we attempt to simplify/normalize the path to remove <code>..</code> and <code>.</code></p> </td></tr> <tr valign="top"><td><code>escapeQuery</code></td> <td> <p>a logical value. Currently ignored.</p> </td></tr> </table> <h3>Details</h3> <p>This uses the function <code>parseURI</code> to compute the components of the different URIs. </p> <h3>Value</h3> <p>A character string giving the fully qualified URI for <code>u</code>. </p> <h3>Author(s)</h3> <p>Duncan Temple Lang</p> <h3>See Also</h3> <p><code><a href="parseURI.html">parseURI</a></code> which uses the libxml2 facilities for parsing URIs. </p> <p><code><a href="xmlTreeParse.html">xmlParse</a></code>, <code><a href="xmlTreeParse.html">xmlTreeParse</a></code>, <code><a href="xmlTreeParse.html">xmlInternalTreeParse</a></code>. XInclude and XML Schema import/include elements for computing relative locations of included/imported files.. </p> <h3>Examples</h3> <pre> getRelativeURL("http://www.omegahat.net", "http://www.r-project.org") getRelativeURL("bar.html", "http://www.r-project.org/") getRelativeURL("../bar.html", "http://www.r-project.org/") </pre> <hr /><div style="text-align: center;">[Package <em>XML</em> version 3.99-0.3 <a href="00Index.html">Index</a>]</div> </body></html>