XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] xml:base and fragments

On 05/05/17 00:08, C. M. Sperberg-McQueen wrote:
[...]
> Imagine a document at http://example.com/doc.html:
> 
>     <html>
>       <head> 
>         <base href="http://dictionary.example.com/entries/a.html";>
>         …
>       </head>
>       <body>
>         <p id="apple">Dummy text</p>
>         …
>         <p>Where do we think <a href="#apple">this link</a> goes?
>         What <a href="res.html">resource</a>(s) do we think it identifies?</p>
>       </body>
>     </html>

I have added another 'a' element; see below.

> The documentation of the ‘base’ element I’ve seen seems to make
> clear that the link points to http://dictionary.example.com/entries/a.html#apple
> and RFC 3986’s definition of URIs and the meaning of relative references 
> says that the resource identified is found in the current entity and should 
> be dereferenced without a new retrieval action.

Forgive me if I send my mindbot back that far into the past, but my
memory tells me that the purpose of the 'base' element type in HTML was
to specify that fragmentary directory-or-file type URIs in links in the
document should be constructed using the base URI given, not the URI of
where you got the document. There is a good example of this at
https://listserv.heanet.ie/cgi-bin/wa?A2=ind9409&L=HTML-WG&P=R14682

At the time, I don't think #fragment identifiers were considered.

In your example above, as I have modified it, the link at 'resource'
should therefore resolve to
http://dictionary.example.com/entries/res.html and not to
http://example.com/res.html

I think the original reason was that if this was my document (from
dictionary.example.com), changing the base would allow Michael to serve
the document from example.com without having to update all the internal
links, but just set the 'base' element to point at the document's "real"
location.

For the #fragment identifier to be resolved relative to the 'base' URI
is a trap for designers and users and authors because "everyone knows"
(hah!) that #fragments refer to @name attributes of 'a' links or (now)
to IDs *within the current document*. But they don't; as Michael said:

> And of course Web browsers aren’t always trying to implement
> the specs.)

Here endeth the first lesson.

///Peter



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS