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

Re: XPath and find/findAll methods

From: James Graham <jgraham@opera.com>
Date: Tue, 22 Nov 2011 13:16:18 +0100
Message-ID: <4ECB9292.6060202@opera.com>
To: Simon Pieters <simonp@opera.com>
CC: public-webapps@w3.org, "\"Martin Kadlec\" (BS-Harou)" <bs-harou@myopera.com>
On Tue 22 Nov 2011 01:05:18 PM CET, Simon Pieters wrote:
> On Mon, 21 Nov 2011 20:34:14 +0100, Martin Kadlec 
> <bs-harou@myopera.com> 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.
> Maybe FF/Chrome/Safari should add support for selectNodes?

Right, one of the issues with XPath is that the DOM3 XPath API is 
without doubt the worst API on the web platform. With a sane API there 
might be more demand for XPath since it can be used for things that the 
CSSWG are unlikely to ever allow in selectors for performance reasons. 
As Simon points out, there is even a preexisting API that does more or 
less the right thing and is implemented in IE and Opera.
Received on Tuesday, 22 November 2011 12:16:55 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC