[annotator-dev] About the future of the Range implementation
riccardo.tasso at gmail.com
Wed Jun 18 15:32:04 UTC 2014
Off Topic: how can I use built-in parsers to get the xpath of a given dom
element and vice-versa?
(I had to implement my own parser as I didn't know which were the
2014-06-18 17:10 GMT+02:00 Randall Leeds <tilgovi at hypothes.is>:
> On Jun 17, 2014 11:21 PM, "Riccardo Tasso" <riccardo.tasso at gmail.com>
> > Just a question: why did you choose xpath instead of css selector which
> are parsed by jquery?
> 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...
More information about the annotator-dev