What's New
  • 19/04/2009 - version 0.2.8 released
  • 27/08/2008 - version 0.2.7 released
Project Owner

Doug Daniels

  • Matthew Wilson
  • Eliot Setzer

Project Description

XPointerLib is a project providing XPointer support for Firefox versions up to 3.6. This code was motivated by the Annotea Project's use of XPointers to specify annotation locations. It originally lived inside of Annozilla, a Mozilla-based annotations client. Today it has evolved into a standalone XPCOM Service implemented in JavaScript.

Latest update

The latest release is 0.2.8, which fixes some bugs relating to the creation of XPointers.

Installation and Use

IMPORTANT: First, read the list of caveats and notes for this release.

Next, visit the installation page for instructions on downloading and installing the component.

After installation, see the examples page for sample uses of the code.

For the Curious

XPointers are used to uniquely specify a set of locations within a document. They are powerful enough to locate any subset of the document. That is, every fragment of a well-formed XML document can be captured by an XPointer.

XPointerLib allows you to create and resolve XPointers in W3C DOM Documents. Creation is implemented more fully than resolution. For any valid DOM Range or Mozilla Selection object, a function in the XPointerLib will create an equivalent XPointer.

Resolution is a bit dicier. I've implemented a solid chunk of the XPointer specification, but there's still a lot to write. Currently, the resolver will handle a slightly larger set of XPointers than the set that the creator spits out. The resolver's handling capacity is still shy of complete XPointer, but as far as I can tell nobody has implemented complete XPointer evaluation yet.

The resolver is written in JavaScript as a hand-coded recursive descent parser with ad-hoc syntax-directed evaluation. As such, adding more functionality should mean grafting in routines to handle new parts of the XPointer grammar. If you are familiar with JavaScript and XPointer and would like to help out, send me a message.

If you're unfamiliar with these technologies but would still like to help, I have prepared a page with useful links for learning about XPCOM, XPointer, XPath, and other strange and wonderful technologies utilized by XPointerLib.

The xpointerlib project can be contacted through the mailing list or the member list.
Copyright © 2000-2020. All rights reserved. Terms of Use & Privacy Policy.