XPath, a query language built into every major browser, may be removed from the browser stack. A WHATWG GitHub discussion (issue #11523) proposes stripping XSLT from browsers, and while XPath is not named in that proposal, the conversation signals how much legacy XML technology is quietly at risk of deprecation. That risk is worth understanding before it becomes a surprise.
The article's core argument is practical, not nostalgic. CSS selectors cannot locate a DOM element based on its current position in the tree. XPath can. The author, Bryan Rasmussen, demonstrates a custom JavaScript constructor that bridges document.evaluate with querySelectorAll, exposing both queryCSSSelectors and queryXPaths as unified methods on the document object. That gap between what CSS queries and what XPath queries is the technical reason this older stack still has a job to do in 2024.
The piece is worth reading in full because the argument is built from working code, not theory. Rasmussen also frames a broader problem: modern framework abstractions like React quietly eliminate developer contact with foundational browser APIs, including the CSSOM, page lifecycle events like beforeunload and visibilityChange, and dynamic stylesheet loading. Developers who never hit those layers are the ones blindsided when an abstraction breaks and the underlying platform is unfamiliar.
[READ ORIGINAL →]