[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xml:base and fragments

  • From: Peter Flynn <peter@silmaril.ie>
  • To: xml-dev@lists.xml.org
  • Date: Mon, 8 May 2017 19:33:16 +0100

Re:  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

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

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"

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.


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


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.