[tocml-list] Identifying the TOCML file for a page

Curtis Duhn curtis@duhn.com
Fri Jan 25 00:38:00 2002


I've been thinking about the best way for the browser to figure out what
TOCML file to load as the site map for a given page.  I thought about
using a well known file name that the browser could look for, sort of
like favicon.ico, but I decided I don't like the idea of polluting
everyone's Apache logs with failed requests for sitemap.toc.

Instead, it seems the right way to do it is to use HTML's LINK tag.  It
appears to be designed for this type of thing.  Each page could link to
its site map using a tag like this:

<LINK REV="Contents" TYPE="text/xml"
HREF="http://www.duhn.com/tocml/sitemap.toc#tocml.vision">

When the browser sees this tag, it can go fetch the TOCML file and expand
it to show the node with id="tocml.vision" as the current node.

As I understand it, REV="Contents" tells the user agent that the specified
URL is a table of contents that links to this page.  If we use the
"Contents" link-type, I'm thinking we should also encourage the
TYPE="text/xml" attribute.  The user agent can use this as a hint that it
should go ahead an load the TOC rather than just displaying a link, which
it might do for an HTML TOC.

"Contents" is a predefined link type in HTML 4.0.  Since its
intended use is to point to a TOC file, it makes sense to use it
for our purposes.  There's some risk in this though, since some user
agents might be expecting to find HTML at the other end of the link.

If browsers have well-established and incompatible behavior for this link
type, it might make sense to define our own link-type for TOCML site maps.
There isn't a predefined link type for site map, so perhaps REL="map"
would be appropriate.  The HTML 4.0 spec does allow for author defined
link-types, saying, "Authors may wish to define additional link types not
described in this specification. If they do so, they should use a profile
to cite the conventions used to define the link types.  Please see the
profile attribute of the HEAD element for more details."

I whipped up a little test page with the proposed link tag above.  Mozilla
0.9.7 doesn't seem to pay any attention to it.  If you guys are using
other browsers, can you try this link and see if your browser renders
anything in response to the LINK tag?

http://www.duhn.com/tocml/test.html

Curtis Duhn
curtis@duhn.com