A. Pagaltzis wrote:
* Sjoerd Visscher <[EMAIL PROTECTED]> [2005-07-18 11:50]:

Yes, your <link href="" /> resolves to
http://www.tbray.org/ongoing/ But if you say "follow that link"
in a program with same-document references support, it will
say: "Ok, the link points to http://www.tbray.org/ongoing/, and
the base URI is http://www.tbray.org/ongoing/ as well, so I
have to return the current document instead of doing a new
request."


He is correct, Tim. The base URI means “the URL where this
document was found,” not “the prefix for any enclosed relative
links.” I don’t see how RFC3986 can be read any other way.

I am correct ;), but your explanation is wrong. 5.1 says clearly that the "Base URI embedded in content" precedes any other way of establishing a base URI. So the base URI is <http://www.tbray.org/ongoing/>, and the empty relative URI therefore refers to <http://www.tbray.org/ongoing/>.

But now the "URI reference refers to a URI that is, aside from its fragment component (if any), identical to the base URI", so it is a same-document link, and when "a same-document reference is dereferenced for a retrieval action, the target of that reference is defined to be within the same entity (representation, document, or message) as the reference; therefore, a dereference should not result in a new retrieval action."

It is a very complicated way of calculating that an empty relative URI is always the current document, no matter what the base URI is.

So it would be

    <feed xmlns='http://www.w3.org/2005/Atom'
          xml:base='http://www.tbray.org/ongoing/ongoing.atom'
          xml:lang='en-us'>
    <title>ongoing</title>
    <link href='./' />
    <link rel='self' href='' />
      ...
    <entry xml:base='When/200x/2005/07/14/Atom-1.0'>

If you want it to be perfect xml:base on the entry would be the URI of the Atom Entry Document. And the html base URI should go on the xhtml div element. Just like you get when the entries and the div elements are XIncluded.

If we wanted to avoid this, we should have added language to the
spec that atom:[EMAIL PROTECTED]'alternate'] should never be considered
a same-document reference, maybe.

If your XML package has support for data-typing, xml:base and same-document references, then you could no longer do

  Node n = link.getAttribute("href").dereference();

because Atom would no longer follow standard behaviour.

--
Sjoerd Visscher
http://w3future.com/weblog/

Reply via email to