Can XPointer “follow” links?
-
25-10-2019 - |
Pergunta
I know I can specify a node another document using XPointer:
http://www.google.com/#xpointer(...)
But, can I specify an a/@href node in the current document, and point to a node in that document?
Solução
Use something like this to go to the root node first, then back down to the hyperlink:
#xpointer(here()//ancestor::*[1]/ancestor::*[1]/descendant::a[@id='#1'])
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow