In article <20****************************@home.porton.narod. ru>,
Victor Porton <po****@home.porton.narod.ru> wrote:
What can be and what should be xml:base attribute?
It should be the base URI that you want to use for resolving relative URIs
in the document.
Normally the base URI is the URI of the document itself. However,
only the "directory" part of it is relevant for resolving relative
URIs, so it doesn't really matter what appears after the last slash of
the path part.
Should/can it end with a slash? What to do if it
doesn't end with a slash?
When resolving relative URIs, the part after the last slash of the
path part is removed and replaced with the relative URI. So these are
the effectively the same:
http://example.org/foo/bar/baz
http://example.org/foo/bar/
and are different from
http://example.org/foo/bar
If you use them to resolve "one/two" you will get
http://example.org/foo/bar/one/two
in the first two cases, and
http://example.org/foo/one/two
in the third.
If xml:base="http://xxx.org/aaa/" anything is clear.
But what if xml:base="http://yyy.org/bbb"? Does now
href="a.html" mean http://yyy.org/bbb/a.html or
http://yyy.org/a.html?
The latter.
(By the way, if you use your web browser to fetch a directory without
putting the slash on the end, the server sends a redirect to the name
with a slash added, so that relative URIs will work. In most web
browsers you can see the slash appear after you hit return.)
-- Richard