Re: Native DOM way to get nodes of arbitrary type/name

Marat Tanalin <[email protected]>
Newsgroups gmane.comp.web.dom.general
Message-ID <[email protected]>
05.10.2013, 14:12, "Bjoern Hoehrmann" <[email protected]>:
> * Marat Tanalin wrote:
>
>> It would be nice to have a native (usable and performant) DOM way for
>> retrieving DOM nodes by node type (or, alternatively, by node name).
>>
>> This could be represented by these two simple methods:
>>
>> б═б═б═б═* element.getNodesByType(type) -- to get _all_ nodes
>> б═б═б═б═б═б═of specified type contained in the element
>> б═б═б═б═б═б═(like `element.getElementsByTagName('*')` for elements);
>
> Use XPath

Thank you for your attention, Bjoern.

My message is not about searching for an instantaneous existing solution (nor the mailing list is a forum for questions of such type).

My message is a proposal intended to improve the DOM standard in general and to make it more universal and consistent.

XPath is not DOM or a part of it.
XPath is not as intuitive/easy-to-use as DOM.
XPath involves parsing "selector" always.

Of course, XPath could still be utilized for polyfilling the proposed DOM features in older XPath-capable browsers.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.