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

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 UTC