- From: Andrea Giammarchi <notifications@github.com>
- Date: Thu, 15 Oct 2020 04:44:10 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 15 October 2020 11:44:22 UTC
@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