Re: [whatwg/dom] Suggestion: new method - getNodesByType (#992)

> @liamquin The goal of this method is to attain a list of nodes of the request type from descendant nodes _irrespective of additional specificity_. An XPath instance requires a working knowledge (or discovery thereof) of a tree instance and a non-element type can only be accessed via an element, just like all other DOM methods and properties. That is very different than the goals of the method presented here.

Utter total bullshit and nonsense.   The example I gave earlier, ``` tbody/tr/th[contains(., "Esterhazy")]/following-sibling::th[2]```, finds a th element containing the text string Esterhazy and returns the next the element, if there is one, in the same tr. You could write just, e.g. //text()[contains(., "Esterhazy")]  to find a matching text node, or from any given node you can write .//text() to get only descendants at any level.  No knowledge of  tree required, and not the case that a non-element type can only be accessed via an element, either.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/992#issuecomment-867202633

Received on Wednesday, 23 June 2021 22:32:19 UTC