XPointer


XPointer is a W3C standard (http://www.w3.org/TR/xptr-framework/) where the fragment identifier (also known as hashtag suffix) of a URL can provide link information to any portion of HTML, XHTML XML documents. (also see for John E. Simpson's XPath and XPointer for more information).

Although fragment identifiers have mainly been used for anchor links, their availability depends on the publisher having included the anchor or "id" attribute hooks within the target file. When anchors or ids are not provided by the official source, Legislink "reads" the file and adds the anchor on behalf of the user, but then must store the file at legislink.org in order to provide direct access to the internal location. For documents that contain anchors or ids, LegisLink links to the file at the official site. Anchors and ids contained in these files are not exposed to Internet users except when the publisher explicitly provides links to those locations (e.g., a table of contents). Many of these documents are rich in anchors and ids. When the publisher includes anchors or ids, LegisLink "reads" the file and searches for those anchors and automatically redirects the user to the hopefully correct location within the file at the official site. (Note that in XHTML 1.0 named anchors (<a name="") are deprecated and in XHTML 1.1 they are removed.)

For documents based on markup languages (HTML, XHTML, and XML), XPointer provides a syntax for linking to locations within a document based on the structure of the document (e.g., the second <section> element), specifiying an xpath to a location, or more complex XPath expressions. Adobe's Acrobat plug-in uses the same strategy with additional "open" parameters which are documented at http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf. Adobe's approach works with any PDF file because the plug-in handles the parameters, not the browser. One problem with the plug-in is that it seems to only work when retrieving the PDF file the first time (e.g., once you're viewing the PDF file, you can't simply change the parameters in the URL to navigate to various pages).

Most browsers have not included the XPointer capability. However, Firefox has an extension/plug in to allow for XPointers to work (http://www.codedread.com/fxpointer/). Fortunately, XPointer enhanced URLs still point to the top of the document indicated in the URL (essentially the hashtag XPointer is ignored).

Here is a link to some more explanation and examples: http://advocatehope.org/tech-tidbits/xpointer

Browser Support

Here are some of the browsers bug reports that discuss XPointer. Please note that you can vote and/or add comments.
Chrome: http://code.google.com/p/chromium/issues/detail?id=25026
Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=32832

Also see http://en.wikipedia.org/wiki/Fragment_identifier