Re: [whatwg/dom] Proposal - Update XPath to (at least) v2.0 (#903)

@sergeykish with XPath I can select even attribute nodes and/or text nodes, and this is gold for libraries based on template literals ... as example, this single query `//*/@*["${uid}"] | //*[contains(text(),"${uid}")]/text()` lets me remove a tree walker with checks all over for the attribute content or text content, XPath does that in one line, because it's a language born to query the tree, not to style it. I wouldn't mind having `queryXPath` and/or `queryXPathAll`, if that helps adding `matches`,  but I really hope `matches` can be added as amend of XPath 1.

The rest of the functions are also well known, and there are cheatsheets that help with it too:
https://devhints.io/xpath#class-check

-- 
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/903#issuecomment-709230700

Received on Thursday, 15 October 2020 11:44:22 UTC