Re: Is this use of BASE kosher?

Daniel W. Connolly (
Mon, 31 Jul 95 12:37:17 EDT

In message <>, "Peter K. Sheerin" writes:
>I ran across someone with a very interesting document, that has a bunch of
>relative links that don't work, because of the presense of a BASE URL in
>the document header.
>The URL used here, though, points to an entirely different page -- one
>which doesn't contain the named sections specified in the relative URLs.

I'm having trouble determining exactly what your question is.
"kosher" and "doesn't work" aren't very well-defined terms.

Regarding the attached document excerpt, I can answer these

Q1. Is this a conforming HTML document?

A. first, is is a conforming SGML document?
well... it's got some errors. I'll change:
<link content="..."> => <link href="...">
<img name="..."> => <img >
quote some attribute values...

OK. now it's a conforming SGML document.

and I can't see that it violates any HTML rules, so yes, it's a
conforming HTML document (after the above fixes).

Q2. What is the address of the head of the link whose tail is "Support
and ..."

A2. Support

(space and %20 have identical semantics. Both are correct.)

now for the tricky part...

Q3. I've got this document in my browser, and I click on "Support
and ..." and it fetches a whole new document, and fails to find
the anchor in question. Is this conforming behaviour?

A3. Well, the HTML 2.0 spec doesn't really govern this sort of
thing, but it seems to be a pretty brain-dead implementation.

When the browser is viewing this document, regardless of where
it got the document, it should consider the document's address
to be: .

So when it sees a link to "#Misc...", it may:

1. Resolve this partial URI into a full URI using the
BASE address, and resolve the resulting absolute URI.
(as per 7.2. "Activation of Hyperlinks" and 7.1. "Accessing Resources")
At this point, it should realize that it's already resolved
that URI, and it's got the document on screen. It need
only visit the anchor named "#Misc..."
(as per 7.4. "Fragment Identifiers").


2. It may go and fetche a new copy of the document.
If the new copy doesn't have the named anchor, then
this is an error. The implementation is still conforming --
the fault is the information provider's for not making the
information at the <base> address the same as the info in the
given document.


3. Bypass all that and realize that "#xxx" is _always_
a reference to the current document:

|7.4. Fragment Identifiers
| Any characters following a `#' character in a URI constitute a
| fragment identifier. As a degenerate case, a URI of the form
| `#fragment' refers to an anchor in the same document.

document in question follows:

I've added a test case to my test suite to cover this issue:

I'm trying to get back to my old methodology of representing issues
by test cases in my test suite. Stay tuned for details...

><base href="">
><link rel="parent" href="/ftp-sites/Peripherals.html">
><link rel="coll-home" href="/ftp-sites/Peripherals.html">
><meta name="coll-banner" content="/ftp-sites/bb-ftp-peripherals.gif">
><meta name="reply-to" content="">
><link rel="reply-link" content="/ahp/Comments.html">
><meta name="coll-name" content="ftp-sites">
><meta name="lm-id" content="ftp-sites">
><meta name="aliases" content="/Misc/Peripherals.html">
><title>HP Computer Product and Peripherals Anonymous FTP Site</title>
><a href="/ftp-sites/Peripherals.html">
><img name="TOP"
> src=/ftp-sites/bb-ftp-peripherals.gif></a>
><a href="/cgi-bin/imagemap/ftp-sites/">
> <img src=/Graphics/TopRight.gif ISMAP></a>
> <p>
><h2> Quick Scroll to: </h2>
><li> <a href="#Miscellaneous Support"><b>Support and Utility Files</b></a>
><li> <a href="#HP NetServer Computer Products"><b>HP NetServer Computer
> Products</b></a>
><a name="Miscellaneous Support"><h3>Support and Utility Files</h3></a>
><li> <a href="">
> Miscellaneous Support and Utility Files</a>
><a name="HP NetServer Computer Products"><h3>HP NetServer Computer
><li><a href="
>server_lc">HP NetServer LC Files</a>
><li><a href="
>server_le">HP NetServer LE Files</a>
><li><a href="
>server_lf">HP NetServer LF Files</a>
><li><a href="
>server_lm">HP NetServer LM Files</a>
><li><a href="
>"> HP NetServer Support Information</a>
><a name="HP Vectra Computer Products"><h3>HP Vectra Computer
><li> <a href="
> HP Vectra RS QS and ES Computer Files</a>
><li> <a href="
> HP Vectra 486 EISA Computer Files</a>
><li> <a href="
> HP Vectra 486 and Pentium Computer Files</a>
><li> <a href="">
> HP PC Video Files</a>
><li> <a href="
> HP SCSI Host Adapter Files</a>
><li> <a href="">
> HP Vectra Support Information</a>
><!-- End Body -->
><p><a href=#TOP><img src=/Graphics/BottomLeft.gif></a>
><a href=/cgi-bin/imagemap/ftp-sites/>
> <img src=/Graphics/BottomRight.gif ISMAP></a>
><a href="#TOP">Top</a> |
><a href="/AccessGuide/AccessGuide.html">Access Guide</a> |
><a href="/AccessGuide/Search.html">Search</a> |
><a href="/ftp-sites/Peripherals.html">Up</a> |
><a href="/home.html">Access HP</a>
><a href=/ahp/Comments.html>Contact</a>
>with questions or problems with this service.
><br><A href=/ahp/HPCopyright-95.html>
>(c) Copyright 1995 Hewlett-Packard Company.</A>