Same-document references and XML Base

It does not seem to me that XML Base makes it sufficiently clear what
to do in the following case:

  <!-- document being read from http://www.example.com/foo.xml -->
  <doc xml:base="http://www.ontopia.net/bar.xml">
    <!-- ... -->

    <link xlink:href="#baz"/>
  </doc>

What does this link resolve to? Is it

  http://www.example.com/foo.xml#baz

or is it

  http://www.ontopia.net/bar.xml#baz

?

Given what section 4.2 of RFC 2396 says it seems clear to me that the
answer is the former, but there is a persistent body of opinion that
holds that it is the second. XML Base is entirely silent about this,
and RFC 2396 is nowhere near as clear as it ought to be.

I think this should be recorded as an XML Base erratum, and that if
the spec is ever revised an example showing the correct behaviour in
this case should be added, possibly with a note referring to RFC 2396.

Otherwise I think 99% of implementors will get this wrong. The idea of
a distinction between the base URI and the document URI is something
most people just haven't thought of.

Anyway, a definitive answer would be much appreciated.

-- 
Lars Marius Garshol, Ontopian         <URL: http://www.ontopia.net >
GSM: +47 98 21 55 50                  <URL: http://www.garshol.priv.no >

Received on Wednesday, 23 April 2003 08:29:44 UTC