Re:Chrome will Soon Let You Share Links to a Specific Word o...
by csarven on Friday February 15, 2019 @08:36AM
(#19170768)
XPointer is one of options for a fragment selector in W3C Reference Note on Selectors and States: https://www.w3.org/TR/selectors-states/
XPointer and XPath have been ratified by the W3C in (...checks...) 2003. They have since been revised, slimmed down and used in countless XML-based applications and specs.
The cool thing about XPointer is that it is basically impossible that its fragments are already used in the target document. No site would break if XPointer were used.
Examples of XPointers:
* Pointer to _all_ the occurrences of "target text" anywhere in the page (goodbye JS-inserted <mark>)
#xpointer(string-range(//,"target text"))
Pointer to all occurrences of "target text" in a <p> in the <main> article
#xpointer(string-range(//main//p,"target text"))
* Pointer to the second <h2> heading
#xpointer(//h2[2])
* Pointer to that specific bullet point that you want your colleague to change ASAP
#xpointer(//ul[7]/li[3])
* Abbreviated fall-back to XPath
#//ul[7]/li[3]