W3C home > Mailing lists > Public > public-webapi@w3.org > March 2008

Re: [Element Traversal LC] access to element by index

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Fri, 28 Mar 2008 17:08:55 +0100
Message-ID: <47ED1817.4000004@disruptive-innovations.com>
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: "Web APIs WG (public)" <public-webapi@w3.org>

Bjoern Hoehrmann wrote:

>>    b. you add
>>
>>         Node    item(in unsigned long index);
>>
>>       but that is not really consistent with the existing way of
>>       querying list of nodes.
>>
>>    My very strong preference goes to solution a.
> 
> At the least you would need a different name as this would go on all

Oh sure. Sorry for that, my 7am conf call disturbed me a bit :-)
Anyway, that's not my preferred solution here.

> element nodes and you would probably run into name clashes quickly, and
> confuse authors (NodeList.item vs. Element.item for example). However,
> you could also just use XPath, or Selectors, or one of the many other
> methods for this particular case, I don't think this addition is needed.

I do think this is needed. Having a complex and powerful method to do
something is never an excuse for not having a simple and dedicated way
to do the same thing. Please see that from a web author's perspective.
I must add that from an implementor's perspective, dealing with
firstElementChild is FAR easier than dealing with the results of
an XPath query...

</Daniel>
Received on Friday, 28 March 2008 16:09:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 28 March 2008 16:09:30 GMT