W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: XPath and find/findAll methods

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Tue, 22 Nov 2011 13:31:40 +0100
Message-ID: <4ECB962C.3070901@lachy.id.au>
To: "\"Martin Kadlec\" (BS-Harou)" <bs-harou@myopera.com>
CC: public-webapps@w3.org
On 2011-11-21 20:34, Martin Kadlec (BS-Harou) wrote:
> Hello everyone, I've noticed that the find/findAll methods are
> currently being discussed and there is one thing that might be a good
> idea to consider.
>
> Currently, it's quite uncomfortable to use XPath in javascript. The
> document.evalute method has lots of arguments and we have to remember
> plenty of constants to make it work. IE and Opera support selectNodes
> method on NodePrototype, which is really useful, but what's the point
> in using it when it doesn't work in FF/Chrome/Safari.
>
> My idea is to combine querySelector/All and selectNodes methods. This
> combination - find/findAll - would make using XPath much easier and
> it might give a good reason to lot's of programmers to use it instead
> of querySelector/All although it's going to be newer technology.

This idea seems similar to how JQuery used to support both Selectors and 
XPath in the same API [1].  Support was subsequently removed in 1.2, and 
at the time moved to an XPath Compatibility Plugin [2].  However, the 
link to the actual plugin page now returns a 404, and I can't find that 
plugin or any replacement elsewhere.

This seems to suggest that support for XPath was not considered 
important enough for its continued maintenance.

Are there any other popular libraries that do still offer XPath APIs, or 
is there any data showing that authors really want to use it?

[1] http://docs.jquery.com/DOM/Traversing/Selectors#XPath_Selectors
[2] http://docs.jquery.com/Release:jQuery_1.2#XPath_Compatibility_Plugin

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/
Received on Tuesday, 22 November 2011 12:32:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:48 GMT