Re: Is this use of BASE kosher?

Daniel W. Connolly (connolly@beach.w3.org)
Fri, 4 Aug 95 14:38:25 EDT

>> How would people feel about adding text in a future version of the
>> standard to say that
>>
>> ...
>>
>> (3) if the complete URI formed to resolve a relative reference
>> is the current document or a location within the current
>> document (where the "current document" is defined to be
>> what is specified by BASE or, if BASE is not present, the URI
>> under which the document was retrieved, then the browser
>> shall resolve it within the current copy of the document

What I actually added was this:

http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_7.html#SEC65
Fri Aug 4 17:53:04 1995

|If the URI in the address of the head anchor is the same as the base
|URI, then the base document is sufficient as a representation of the
|resource. A user agent must not, for example, use any network
|information retrieval protocols to obtain a new representation of the
|resourse.

Here's the whole revised Hyperlinks section, for ease of replying:

Note that:
* the stuff in an HREF attribute is now called an "anchor address,"
not a URI. An anchor address is a URI, optionally followed by
'#' and a fragment identifier.

* I was much more careful with the terms _document_ and _resource_
(a document is a sequence of characters; a resource isn't
directly observable: all you know is that it's got an
identifier (URI), and you may be able to get representations
of it via networked information retrieval protocols)

* I removed references to "the base URI of the document" and
other such idioms that made it sound like the base URI is
a property of the document. The base URI is a property
of the state of the user agent.

Hyperlinks

In addition to general purpose elements such as paragraphs and lists,
HTML documents can express hyperlinks. An HTML user agent allows the
user to navigate these hyperlinks.

A hyperlink is a relationship between two anchors, called the head and
the tail of the hyperlink[DEXTER]. Each anchor is addressed, or
uniquely identified, by an absolute Uniform Resource Identifier (URI),
optionally followed by a '#' and a sequence of characters called a
fragment identifier, as per [RELURL]. For example:

http://www.w3.org/hypertext/WWW/TheProject.html
http://www.w3.org/hypertext/WWW/TheProject.html#z31

In an anchor address, the URI refers to a resource; it may be used in
a variety of information retrieval protocols to obtain an entity that
represents the resource, such as an HTML document. The fragment
identifier, if present, refers to some view on, or portion of the
resource.

An HTML user agent begins navigation with an absolute URI, called the
base URI, and an HTML document that is a representation of the
resource identified by the base URI.

Each of the following markup constructs indicates the tail anchor of a
hyperlink or set of hyperlinks:

* A elements with HREF present.
* LINK elements.
* IMG elements.
* INPUT elements with the SRC attribute present.
* ISINDEX elements.
* FORM elements with `METHOD=GET'.

These markup constructs refer to head anchors either directly by means
of an absolute URI, or indirectly by means of a relative URI, which
must be combined with the base URI as in [RELURL] to determine the
address of the head anchor. The markup may also include fragment
identifiers, separeted from the URI by a '#' character.

Accessing Resources

Once the address of the head anchor is determined, the user agent may
obtain a representation of the resource, for example as in [URL].

For example, if the base URI is `http://host/x/y.html' and the
document contains:

<img src="../icons/abc.gif">

then the user agent uses the URI `http://host/icons/abc.gif' to access
the resource linked from the IMG element.

If the URI in the address of the head anchor is the same as the base
URI, then the base document is sufficient as a representation of the
resource. A user agent must not, for example, use any network
information retrieval protocols to obtain a new representation of the
resourse.

Activation of Hyperlinks

An HTML user agent allows the user to navigate the content of the
document and request activation of hyperlinks denoted by A
elements. HTML user agents should also allow activation of LINK
element hyperlinks.

To activate a link, the user agent obtains a representation of the
resource identified in the address of the head anchor. If the
representation is another HTML document, navigation may begin again
with this new document. The base URI for navigation is taken from the
head anchor by default; however, any BASE tag in the destination
document overrides this default. The process of obtaining the
destination document may also override the base URI, as in the case of
an HTTP `URI:' header or redirection transaction.

Simultaneous Presentation of Image Resources

An HTML user agent may activate hyperlinks indicated by IMG and INPUT
elements concurrently with processing the document; that is, image
hyperlinks may be processed without explicit request by the
user. Image resources should be embedded in the presentation at the
point of the tail anchor, that is the IMG or INPUT element.

LINK hyperlinks may also be processed without explicit user request;
for example, style sheet resources may be processed before or during
the processing of the document.

Fragment Identifiers

Any characters following a `#' character in a hypertext address
constitute a fragment identifier. As a degenerate case, an address of
the form `#fragment' refers to an anchor in the same document.

The meaning of fragment identifiers depends on the media type of the
representation of the anchor's resource. For `text/html'
representations, it refers to the A element with a NAME attribute
whose value is the same as the fragment identifier. The matching is
case sensitive. The document should have exactly one such element. The
user agent should indicate the anchor element, for example by
scrolling to and/or highlighting the phrase.

For example, if the base URI is `http://host/x/y.html' and the user
activated the link denoted by the following markup:

<p> See: <a href="app1.html#bananas">appendix 1</a>
for more detail on bananas.

Then the user agent accesses the resource identified by
`http://host/x/app1.html'. Assuming the resource is represented using
the `text/html' media type, the user agent must locate the A element
whose NAME attribute is `bananas' and begin navigation there.

Queries and Indexes

The ISINDEX element represents a set of hyperlinks. The user can
choose from the set by providing keywords to the user agent. The user
agent computes the head URI by appending `?' and the keywords to the
base URI. The keywords are escaped according to [URL] and joined by
`+'. For example, if a document contains:

<BASE HREF="http://host/index">
<ISINDEX>

and the user provides the keywords `apple' and `berry', then the user
agent must access the resource `http://host/index?apple+berry'.

FORM elements with `METHOD=GET' also represent sets of hyperlinks. See
section Query Forms: METHOD=GET for details.

Image Maps

If the ISMAP attribute is present on an IMG element, the IMG element
must be contained in an A element with an HREF present. This construct
represents a set of hyperlinks. The user can choose from the set by
choosing a pixel of the image. The user agent computes the head URI by
appending `?' and the x and y coordinates of the pixel to the URI
given in the A element. For example, if a document contains:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<head><title>ImageMap Example</title>
<BASE HREF="http://host/index"></head>
<body>
<p> Choose any of these icons:<br>
<a href="/cgi-bin/imagemap"><img ismap src="icons.gif"></a>

and the user chooses the upper-leftmost pixel, the chosen hyperlink is the one
with the URI `http://host/cgi-bin/imagemap?0,0'.