On Jun 17, 2014 11:21 PM, "Riccardo Tasso" <[email protected]> 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.
_______________________________________________ annotator-dev mailing list [email protected] https://lists.okfn.org/mailman/listinfo/annotator-dev Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev
