W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2011

Re: DOM XPath and Text nodes

From: Robin Berjon <robin@berjon.com>
Date: Wed, 14 Sep 2011 12:02:28 +0200
Cc: www-dom@w3.org
Message-Id: <8FCEA138-5B39-4997-95FA-01E8AFCD5D2E@berjon.com>
To: Anne van Kesteren <annevk@opera.com>
On Sep 13, 2011, at 20:47 , Anne van Kesteren wrote:
> On Tue, 13 Sep 2011 20:38:38 +0200, Bjoern Hoehrmann <derhoermi@gmx.net> wrote:
>> * Anne van Kesteren wrote:
>>> The couple of bugs filed against Opera indicated authors did expect what
>>> Firefox is doing.
>> 
>> Well, if those reports offer interesting reasoning you are welcome to
>> share the reasoning, but beyond that it's not very interesting; people
>> who expect the Opera behavior are not likely to tell you to change it,
>> and they can't offer opposing views either as the bugs are not public.
> 
> I think it would be more interesting if Gecko or WebKit had bug reports requesting them to match Opera's behavior.

I never bothered to file bugs about it since vendor interest in XPath has been generally low and IE doesn't support it in-document anyway, but I've certainly been bitten by strange behaviours of text() before. This is all the more annoying because support for selecting text() nodes faster than by walking the entire tree by hand is one of the reasons to use XPath instead of Selectors in the first place. I usually address it by calling document.normalize(), which is a PITA.

I don't know if there's a point in saving DOM 3 XPath. It was created by a group that IIRC wasn't convinced that it needed to be done and its design is clunky at the best of times. We'd probably be better off with either something like queryXPath(), or by providing ways of addressing its primary use cases directly (at least text nodes and axes).

-- 
Robin Berjon - http://berjon.com/ - @robinberjon
Received on Wednesday, 14 September 2011 10:02:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT