<spc:wrap xmlns="http://xmlns.livinglogic.de/xist/ns/doc" xmlns:spc="http://xmlns.livinglogic.de/xist/ns/specials">
<p>The class <pyref module="ll.url" class="URL"><class>ll.url.URL</class></pyref>
supports many common schemes and one additional special scheme named
<lit>root</lit> that deserves an explanation.</p>

<p>A <lit>root</lit> &url; is supposed to be an &url; that is relative
to a <z>project</z> directory instead to a base &url; of the document that contains
the &url;.</p>

<p>Suppose we have the following document with the following
base &url;:</p>

<prog>
&gt;&gt;&gt; from ll import url
&gt;&gt;&gt; base = url.URL("root:company/it/about/index.html")
</prog>

<p>Now, if we have the following relative &url; in this document:</p>

<prog>
&gt;&gt;&gt; url1 = url.URL("images/logos/spam.png")
</prog>

<p>the combined &url; will be:</p>

<prog>
&gt;&gt;&gt; base/url1
URL('root:company/it/about/images/logos/spam.png')
</prog>

<p>Now it we use this combined &url; and interpret
it relative to the base &url; we get back our
original relative &url;:</p>

<prog>
&gt;&gt;&gt; (base/url1).relative(base)
URL('images/logos/spam.png')
</prog>

<p>Let's try a <lit>root</lit> &url; now:</p>

<prog>
&gt;&gt;&gt; url2 = url.URL("root:images/logos/spam.png")
</prog>

<p>Combining this &url; with the base &url; gives us
the same as <lit>url2</lit>:</p>

<prog>
&gt;&gt;&gt; base/url2
URL('root:images/logos/spam.png')
</prog>

<p>But if we interpret this result relative to <lit>base</lit>, we'll get:</p>
<prog>
&gt;&gt;&gt; (base/url2).relative(base)
URL('../../../images/logos/spam.png')
</prog>

<p>I.e. this gives us a relative &url; that references <lit>url2</lit>
from <lit>base</lit> when both &url;s are relative to the same root directory.</p>
</spc:wrap>
