[annotator-dev] About the future of the Range implementation

Randall Leeds tilgovi at hypothes.is
Wed Jun 18 15:10:04 UTC 2014

On Jun 17, 2014 11:21 PM, "Riccardo Tasso" <riccardo.tasso at gmail.com> wrote:
> Just a question: why did you choose xpath instead of css selector which
are parsed by jquery?
> Is there a javascript library which parses xpath? If I remember well you
implemented an xpath finder in annotator, but probably it would be usefull
to have it as a separate component too.

Both XPath and CSS are standards, understood by browsers. You don't need
jQuery to use CSS selectors.

We have a simple parser which works on some malformed HTML when the built
in parser fails.

As to why XPath instead of CSS? I believe the nth-of-type selectors and
such are only since CSS3. The types of queries we use XPath for have been
supported much longer.

These days you might be able to accomplish the same with CSS but this is
case is exactly what XPath was designed for.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140618/f3dcbd3a/attachment-0004.html>

More information about the annotator-dev mailing list